Install nvm and code server on the fly

You need to set some variables for that to work.
This commit is contained in:
Andrei Jiroh Eugenio Halili 2021-08-24 21:59:44 +08:00 committed by GitHub
parent 9ab0874dd2
commit 495e650125
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 1 deletions

View File

@ -5,6 +5,7 @@
# if undefined, use $HOME/.local
if [[ $PREFIX == "" ]]; then
export PREFIX=$HOME/.local
mkdir $PREFIX/bin -p
fi
# TODO: Make this better
@ -85,6 +86,11 @@ installDeps() {
sleep 5
}
installNodeVerManager() {
$(command -v curl >>/dev/null && echo "curl -o-" || echo "wget -qO-") https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | NODE_VERSION=${NODE_VERSION:"lts/*"} NVM_DIR="$HOME/.nvm" PROFILE=/dev/null bash
)
}
userspcaeBinDirCheck() {
echoStageName "checking if PREFIX/bin exists"
if [ ! -d "$PREFIX/bin" ]; then
@ -302,7 +308,15 @@ customizeCloudShell() {
sudo $HOME/.customize_environment
}
# TODO: Install VS Code here (or code-server)
# Install VS Code here (or code-server)
installCode() {
if [[ $USE_CODE_SERVER != "" ]]; then
# We'll use the officil script here, because why not? This may take longer on Termux if that's the case.
curl -fsSL https://code-server.dev/install.sh | sh
elif [[ $$XDG_CURRENT_DESKTOP != "" ]]; then
true # It's true for now
fi
}
main() {
# check if the help flag is here
@ -343,6 +357,8 @@ main() {
installTF
installFilterRepo
installShellCheck
[[ $USE_NVM == "true" ]] && installNodeVerManager
installCode
# step 5: copy and symlink files
copyGitConfig