Skip to content

Commit

Permalink
Fix bootstrap arguments passed to pipenv
Browse files Browse the repository at this point in the history
If you don't specify any options to bootstrap.sh, `pipenv_install_args`
will retain its default of an empty string and pipenv will be passed an
empty quoted argument. That's wrong and some versions of pipenv fail
expecting the argument to be a package requirement.

Instead, initialize the variable as an array and append to it as needed.
Bash expands an empty array to nothing using the `"${var[@]}"` notation.
  • Loading branch information
dbnicholson authored and dylanmccall committed Aug 17, 2023
1 parent d3909c5 commit b2eb8fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# Setup Project

# Argument parsing
pipenv_install_args=
pipenv_install_args=()

while :; do
case $1 in
--ci)
# Prevent the Pipfile.lock from being updated automatically. Just use
# the pinned dependencies.
pipenv_install_args=( "--ignore-pipfile" )
pipenv_install_args+=( "--ignore-pipfile" )
;;
-h|-\?|--help|-?*)
echo "Usage: bootstrap.sh [--ci]" >&2
Expand Down

0 comments on commit b2eb8fc

Please sign in to comment.