feat: add nvm install step
This commit is contained in:
parent
70742f2658
commit
1abade9e53
2 changed files with 12 additions and 1 deletions
|
@ -12,12 +12,13 @@ fi
|
||||||
# Ensuring steps are defined.
|
# Ensuring steps are defined.
|
||||||
. ./steps.sh
|
. ./steps.sh
|
||||||
|
|
||||||
TOTAL_STEPS=4
|
TOTAL_STEPS=5
|
||||||
|
|
||||||
# Refer to steps.sh for step definition.
|
# Refer to steps.sh for step definition.
|
||||||
bootstrap() {
|
bootstrap() {
|
||||||
ensure_apt_up_to_date
|
ensure_apt_up_to_date
|
||||||
ensure_apt_dependencies
|
ensure_apt_dependencies
|
||||||
|
ensure_nvm
|
||||||
inject_shell_configuration
|
inject_shell_configuration
|
||||||
inject_vim_configuration
|
inject_vim_configuration
|
||||||
}
|
}
|
||||||
|
|
10
steps.sh
10
steps.sh
|
@ -38,6 +38,16 @@ ensure_apt_dependencies() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ensure_nvm() {
|
||||||
|
pre_step "Installing nvm to manage node version"
|
||||||
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
||||||
|
|
||||||
|
# Ensuring that nvm is usable right away without restarting the shell
|
||||||
|
export NVM_DIR="$HOME/.nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||||
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
|
||||||
|
}
|
||||||
|
|
||||||
# Injects a managed block in the shell configuration.
|
# Injects a managed block in the shell configuration.
|
||||||
inject_shell_configuration() {
|
inject_shell_configuration() {
|
||||||
pre_step "Injecting managed block in shell configuration"
|
pre_step "Injecting managed block in shell configuration"
|
||||||
|
|
Loading…
Reference in a new issue