Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@ fileCommit() {
# get the most recent commit which modified "$1/Dockerfile" or any file COPY'd from "$1/Dockerfile"
dirCommit() {
local dir="$1"; shift
local copyPaths;
(
cd "$dir"
fileCommit \
Dockerfile \
$(git show HEAD:./Dockerfile | awk '
toupper($1) == "COPY" {
for (i = 2; i < NF; i++) {
print $i
}
IFS=" " read -r -a copyPaths <<< "$(git show HEAD:./Dockerfile | awk '
BEGIN { ORS=" "; }
toupper($1) == "COPY" {
for (i = 2; i < NF; i++) {
print $i
}
')
}
')"
fileCommit Dockerfile "${copyPaths[@]}"
)
}

Expand Down