[New] `install.sh`: install bash_completion via script method.

Fixes #1588.
Jordan Harband 2017-08-08 10:11:41 -07:00
parent 389a53cca9
commit 3e1b4591bd
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
1 changed files with 10 additions and 2 deletions

View File

@ -40,6 +40,8 @@ nvm_source() {
NVM_SOURCE_URL="$NVM_SOURCE" NVM_SOURCE_URL="$NVM_SOURCE"
if [ "_$NVM_METHOD" = "_script-nvm-exec" ]; then if [ "_$NVM_METHOD" = "_script-nvm-exec" ]; then
NVM_SOURCE_URL="https://raw.githubusercontent.com/creationix/nvm/$(nvm_latest_version)/nvm-exec" NVM_SOURCE_URL="https://raw.githubusercontent.com/creationix/nvm/$(nvm_latest_version)/nvm-exec"
elif [ "_$NVM_METHOD" = "_script-nvm-bash-completion" ]; then
NVM_SOURCE_URL="https://raw.githubusercontent.com/creationix/nvm/$(nvm_latest_version)/bash_completion"
elif [ -z "$NVM_SOURCE_URL" ]; then elif [ -z "$NVM_SOURCE_URL" ]; then
if [ "_$NVM_METHOD" = "_script" ]; then if [ "_$NVM_METHOD" = "_script" ]; then
NVM_SOURCE_URL="https://raw.githubusercontent.com/creationix/nvm/$(nvm_latest_version)/nvm.sh" NVM_SOURCE_URL="https://raw.githubusercontent.com/creationix/nvm/$(nvm_latest_version)/nvm.sh"
@ -161,9 +163,11 @@ install_nvm_as_script() {
local INSTALL_DIR local INSTALL_DIR
INSTALL_DIR="$(nvm_install_dir)" INSTALL_DIR="$(nvm_install_dir)"
local NVM_SOURCE_LOCAL local NVM_SOURCE_LOCAL
NVM_SOURCE_LOCAL=$(nvm_source script) NVM_SOURCE_LOCAL="$(nvm_source script)"
local NVM_EXEC_SOURCE local NVM_EXEC_SOURCE
NVM_EXEC_SOURCE=$(nvm_source script-nvm-exec) NVM_EXEC_SOURCE="$(nvm_source script-nvm-exec)"
local NVM_BASH_COMPLETION_SOURCE
NVM_BASH_COMPLETION_SOURCE="$(nvm_source script-nvm-bash-completion)"
# Downloading to $INSTALL_DIR # Downloading to $INSTALL_DIR
mkdir -p "$INSTALL_DIR" mkdir -p "$INSTALL_DIR"
@ -180,6 +184,10 @@ install_nvm_as_script() {
echo >&2 "Failed to download '$NVM_EXEC_SOURCE'" echo >&2 "Failed to download '$NVM_EXEC_SOURCE'"
return 2 return 2
} & } &
nvm_download -s "$NVM_BASH_COMPLETION_SOURCE" -o "$INSTALL_DIR/bash_completion" || {
echo >&2 "Failed to download '$NVM_BASH_COMPLETION_SOURCE'"
return 2
} &
for job in $(jobs -p | sort) for job in $(jobs -p | sort)
do do
wait "$job" || return $? wait "$job" || return $?