Skip to content

Commit

Permalink
Fix shell expansion of globs within PATHS var
Browse files Browse the repository at this point in the history
  • Loading branch information
chetan committed Jan 14, 2020
1 parent 00aa3e5 commit 2d2d3f4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh -l
#!/bin/bash -l

set -e

Expand Down Expand Up @@ -53,10 +53,14 @@ if [ "$DEBUG" = "1" ]; then
set -x
fi

# Handle multiple space-separated args but still quote each arg to avoid any
# globbing of args containing wildcards. i.e., if PATHS="/* /foo"
IFS=', ' read -r -a PATHS_ARR <<< "$PATHS"

# Use our dedicated profile and suppress verbose messages.
# All other flags are optional via `args:` directive.
aws --profile invalidate-cloudfront-action \
cloudfront create-invalidation \
--distribution-id "$DISTRIBUTION" \
--paths $PATHS \
--paths "${PATHS_ARR[@]}" \
$*

0 comments on commit 2d2d3f4

Please sign in to comment.