feat: add nvm install step

This commit is contained in:
Marc 2024-01-28 10:59:54 -05:00
parent 70742f2658
commit 1abade9e53
Signed by: marc
GPG key ID: 048E042F22B5DC79
2 changed files with 12 additions and 1 deletions

View file

@ -12,12 +12,13 @@ fi
# Ensuring steps are defined.
. ./steps.sh
TOTAL_STEPS=4
TOTAL_STEPS=5
# Refer to steps.sh for step definition.
bootstrap() {
ensure_apt_up_to_date
ensure_apt_dependencies
ensure_nvm
inject_shell_configuration
inject_vim_configuration
}

View file

@ -38,6 +38,16 @@ ensure_apt_dependencies() {
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.
inject_shell_configuration() {
pre_step "Injecting managed block in shell configuration"