Skip to content

Commit ec3ba19

Browse files
PeterDaveHelloljharb
authored andcommitted
[New] install.sh: Parallel script download jobs
1 parent c6866ee commit ec3ba19

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

install.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,15 @@ install_nvm_as_script() {
172172
nvm_download -s "$NVM_SOURCE_LOCAL" -o "$INSTALL_DIR/nvm.sh" || {
173173
echo >&2 "Failed to download '$NVM_SOURCE_LOCAL'"
174174
return 1
175-
}
175+
} &
176176
nvm_download -s "$NVM_EXEC_SOURCE" -o "$INSTALL_DIR/nvm-exec" || {
177177
echo >&2 "Failed to download '$NVM_EXEC_SOURCE'"
178178
return 2
179-
}
179+
} &
180+
for job in $(jobs -p | sort)
181+
do
182+
wait "$job" || return $?
183+
done
180184
chmod a+x "$INSTALL_DIR/nvm-exec" || {
181185
echo >&2 "Failed to mark '$INSTALL_DIR/nvm-exec' as executable"
182186
return 3

0 commit comments

Comments
 (0)