Skip to content

Commit

Permalink
fix: add fallback for unbound variables in bash3
Browse files Browse the repository at this point in the history
  • Loading branch information
augustobmoura committed Dec 17, 2021
1 parent e0d3804 commit b58ae23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ nodebuild_wrapped() {

install_canon_version() {
local install_type="$1" version="$2" install_path="$3"
local nodebuild_args=()
local args=()

if [ "$install_type" = ref ]; then
nodebuild_args+=(-c)
args+=(-c)
fi

try_to_update_nodebuild

NODE_BUILD_BUILD_PATH="$ASDF_DOWNLOAD_PATH" NODE_BUILD_CACHE_PATH="$ASDF_DOWNLOAD_PATH" \
nodebuild_wrapped "${nodebuild_args[@]-}" "$version" "$install_path"
nodebuild_wrapped ${args+"${args[@]}"} "$version" "$install_path"
}


Expand Down
6 changes: 3 additions & 3 deletions lib/commands/command-nodebuild.bash
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if [[ "${ASDF_NODEJS_CONCURRENCY-}" =~ ^[0-9]+$ ]]; then
fi

nodebuild="${ASDF_NODEJS_NODEBUILD:-$ASDF_NODEJS_NODEBUILD_HOME/bin/node-build}"
nodebuild_args=()
args=()

if ! [ -x "$nodebuild" ]; then
printf "Binary for node-build not found\n"
Expand All @@ -35,7 +35,7 @@ if ! [ -x "$nodebuild" ]; then
fi

if [ "${ASDF_NODEJS_VERBOSE_INSTALL-}" ]; then
nodebuild_args+=(-v)
args+=(-v)
fi

exec "$nodebuild" "${nodebuild_args[@]-}" "$@"
exec "$nodebuild" ${args+"${args[@]}"} "$@"

0 comments on commit b58ae23

Please sign in to comment.