Skip to content

Commit 6e8a75c

Browse files
committed
Quote variable expansions that need to be safe
1 parent 876a474 commit 6e8a75c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

convert-assets.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ for FILE_PATH in $ASSETS_DIR/*.pdf; do
4545
FILE_NAME="${FILE%.*}"
4646

4747
( \
48-
$CONVERT_PDF -r216 -sOutputFile="$IMAGE_OUTPUT_DIR"/"$FILE_NAME".png $FILE_PATH ;\
49-
$CONVERT_PDF -r432 -sOutputFile="$IMAGE_OUTPUT_DIR"/"$FILE_NAME"@2x.png $FILE_PATH ;\
50-
$CONVERT_PDF -r648 -sOutputFile="$IMAGE_OUTPUT_DIR"/"$FILE_NAME"@3x.png $FILE_PATH \
48+
$CONVERT_PDF -r216 -sOutputFile="$IMAGE_OUTPUT_DIR/$FILE_NAME".png "$FILE_PATH" ;\
49+
$CONVERT_PDF -r432 -sOutputFile="$IMAGE_OUTPUT_DIR/$FILE_NAME"@2x.png "$FILE_PATH" ;\
50+
$CONVERT_PDF -r648 -sOutputFile="$IMAGE_OUTPUT_DIR/$FILE_NAME"@3x.png "$FILE_PATH" \
5151
) || true
5252

53-
if [[ $FILE_NAME != "*" ]]; then
53+
if [[ "$FILE_NAME" != "*" ]]; then
5454
# TODO: $PROPERTY_NAME from $FILE_NAME. Converting it to camel case if
5555
# necessary.
5656
echo " $FILE_NAME: require('./img/$FILE_NAME.png')," >> $IMAGE_MODULE
@@ -63,7 +63,7 @@ for FILE_PATH in $ASSETS_DIR/*.{jpg,jpeg,png,gif}; do
6363

6464
cp "$FILE_PATH" "$IMAGE_OUTPUT_DIR/$FILE" 2>/dev/null
6565

66-
if [[ ($FILE_NAME != "*") && (! $FILE_NAME =~ "@") ]]; then
66+
if [[ ("$FILE_NAME" != "*") && (! "$FILE_NAME" =~ "@") ]]; then
6767
echo " $FILE_NAME: require('./img/$FILE')," >> $IMAGE_MODULE
6868
fi
6969
done

0 commit comments

Comments
 (0)