Skip to content

Commit 080160a

Browse files
authored
Handle multiple exclusions with tar.
1 parent 2113173 commit 080160a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

entrypoint.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,15 @@ then
4848
then
4949
tar -zcvf $INPUT_FILENAME $INPUT_PATH || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
5050
else
51-
tar -zcvf $INPUT_FILENAME --exclude=$INPUT_EXCLUSIONS $INPUT_PATH || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
51+
EXCLUSIONS=''
52+
53+
for EXCLUSION in $INPUT_EXCLUSIONS
54+
do
55+
EXCLUSIONS+=" --exclude="
56+
EXCLUSIONS+=$EXCLUSION
57+
done
58+
59+
tar $EXCLUSIONS -zcvf $INPUT_FILENAME $INPUT_PATH || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
5260
fi
5361
else
5462
printf "\n⛔ Invalid archiving tool.\n"; exit 1;

0 commit comments

Comments
 (0)