Skip to content

Commit

Permalink
[New] install.sh: Parallel script download jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterDaveHello authored and ljharb committed Apr 4, 2017
1 parent c6866ee commit ec3ba19
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,15 @@ install_nvm_as_script() {
nvm_download -s "$NVM_SOURCE_LOCAL" -o "$INSTALL_DIR/nvm.sh" || {
echo >&2 "Failed to download '$NVM_SOURCE_LOCAL'"
return 1
}
} &
nvm_download -s "$NVM_EXEC_SOURCE" -o "$INSTALL_DIR/nvm-exec" || {
echo >&2 "Failed to download '$NVM_EXEC_SOURCE'"
return 2
}
} &
for job in $(jobs -p | sort)
do
wait "$job" || return $?
done
chmod a+x "$INSTALL_DIR/nvm-exec" || {
echo >&2 "Failed to mark '$INSTALL_DIR/nvm-exec' as executable"
return 3
Expand Down

0 comments on commit ec3ba19

Please sign in to comment.