Skip to content

Commit b83d190

Browse files
authored
Double quotes around filenames, paths (#47)
1 parent a24011d commit b83d190

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

entrypoint.sh

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ printf "\n📦 Creating %s archive...\n" "$INPUT_TYPE"
77

88
if [ "$INPUT_DIRECTORY" != "." ]
99
then
10-
cd $INPUT_DIRECTORY
10+
cd "$INPUT_DIRECTORY"
1111
fi
1212

1313
if [ "$INPUT_TYPE" = "zip" ]
@@ -16,7 +16,7 @@ then
1616
then
1717
if [ -z "$INPUT_EXCLUSIONS" ]
1818
then
19-
7z a -tzip $INPUT_FILENAME $INPUT_PATH $INPUT_CUSTOM || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
19+
7z a -tzip "$INPUT_FILENAME" "$INPUT_PATH" $INPUT_CUSTOM || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
2020
else
2121
EXCLUSIONS=''
2222

@@ -32,21 +32,21 @@ then
3232
EXCLUSIONS+=$EXCLUSION
3333
done
3434

35-
7z a -tzip $INPUT_FILENAME $INPUT_PATH $EXCLUSIONS $INPUT_CUSTOM || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
35+
7z a -tzip "$INPUT_FILENAME" "$INPUT_PATH" $EXCLUSIONS $INPUT_CUSTOM || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
3636
fi
3737
else
38-
if [ -z "$INPUT_EXCLUSIONS" ]
38+
if [ -z "$INPUT_EXCLUSIONS" ]
3939
then
40-
zip -r $INPUT_FILENAME $INPUT_PATH $INPUT_CUSTOM || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
40+
zip -r "$INPUT_FILENAME" "$INPUT_PATH" $INPUT_CUSTOM || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
4141
else
42-
zip -r $INPUT_FILENAME $INPUT_PATH -x $INPUT_EXCLUSIONS $INPUT_CUSTOM || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
42+
zip -r "$INPUT_FILENAME" "$INPUT_PATH" -x $INPUT_EXCLUSIONS $INPUT_CUSTOM || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
4343
fi
4444
fi
4545
elif [ "$INPUT_TYPE" = "tar" ] || [ "$INPUT_TYPE" = "tar.gz" ]
4646
then
4747
if [ -z "$INPUT_EXCLUSIONS" ]
4848
then
49-
tar -zcvf $INPUT_FILENAME $INPUT_PATH $INPUT_CUSTOM || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
49+
tar -zcvf "$INPUT_FILENAME" "$INPUT_PATH" $INPUT_CUSTOM || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
5050
else
5151
EXCLUSIONS=''
5252

@@ -56,7 +56,7 @@ then
5656
EXCLUSIONS+=$EXCLUSION
5757
done
5858

59-
tar $EXCLUSIONS -zcvf $INPUT_FILENAME $INPUT_PATH $INPUT_CUSTOM || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
59+
tar $EXCLUSIONS -zcvf "$INPUT_FILENAME" "$INPUT_PATH" $INPUT_CUSTOM || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
6060
fi
6161
else
6262
printf "\n⛔ Invalid archiving tool.\n"; exit 1;

0 commit comments

Comments
 (0)