Skip to content

Commit 3eae870

Browse files
authored
Merge pull request #40 from teohhanhui/master
generate-stackbrew-library.sh: Fix detection of deleted files in COPY command
2 parents ab10527 + d55af7c commit 3eae870

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

generate-stackbrew-library.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,18 @@ fileCommit() {
2626
# get the most recent commit which modified "$1/Dockerfile" or any file COPY'd from "$1/Dockerfile"
2727
dirCommit() {
2828
local dir="$1"; shift
29+
local copyPaths;
2930
(
3031
cd "$dir"
31-
fileCommit \
32-
Dockerfile \
33-
$(git show HEAD:./Dockerfile | awk '
34-
toupper($1) == "COPY" {
35-
for (i = 2; i < NF; i++) {
36-
print $i
37-
}
32+
IFS=" " read -r -a copyPaths <<< "$(git show HEAD:./Dockerfile | awk '
33+
BEGIN { ORS=" "; }
34+
toupper($1) == "COPY" {
35+
for (i = 2; i < NF; i++) {
36+
print $i
3837
}
39-
')
38+
}
39+
')"
40+
fileCommit Dockerfile "${copyPaths[@]}"
4041
)
4142
}
4243

0 commit comments

Comments
 (0)