[New] `install.sh`: Parallel script download jobs
parent
c6866eeb37
commit
ec3ba1973a
|
@ -172,11 +172,15 @@ install_nvm_as_script() {
|
||||||
nvm_download -s "$NVM_SOURCE_LOCAL" -o "$INSTALL_DIR/nvm.sh" || {
|
nvm_download -s "$NVM_SOURCE_LOCAL" -o "$INSTALL_DIR/nvm.sh" || {
|
||||||
echo >&2 "Failed to download '$NVM_SOURCE_LOCAL'"
|
echo >&2 "Failed to download '$NVM_SOURCE_LOCAL'"
|
||||||
return 1
|
return 1
|
||||||
}
|
} &
|
||||||
nvm_download -s "$NVM_EXEC_SOURCE" -o "$INSTALL_DIR/nvm-exec" || {
|
nvm_download -s "$NVM_EXEC_SOURCE" -o "$INSTALL_DIR/nvm-exec" || {
|
||||||
echo >&2 "Failed to download '$NVM_EXEC_SOURCE'"
|
echo >&2 "Failed to download '$NVM_EXEC_SOURCE'"
|
||||||
return 2
|
return 2
|
||||||
}
|
} &
|
||||||
|
for job in $(jobs -p | sort)
|
||||||
|
do
|
||||||
|
wait "$job" || return $?
|
||||||
|
done
|
||||||
chmod a+x "$INSTALL_DIR/nvm-exec" || {
|
chmod a+x "$INSTALL_DIR/nvm-exec" || {
|
||||||
echo >&2 "Failed to mark '$INSTALL_DIR/nvm-exec' as executable"
|
echo >&2 "Failed to mark '$INSTALL_DIR/nvm-exec' as executable"
|
||||||
return 3
|
return 3
|
||||||
|
|
Loading…
Reference in New Issue