Skip to content

Commit

Permalink
nvm: add nvm setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ShuN6211 committed Dec 13, 2024
1 parent 8b6c297 commit b23f11e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/zsh/.zshenv
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export ZDOTDIR=$XDG_CONFIG_HOME/zsh
export DENO_INSTALL="$XDG_DATA_HOME/deno"
export DENO_INSTALL_ROOT="$DENO_INSTALL"

### nvm ###
export NVM_DIR="$XDG_DATA_HOME/nvm"

# Rust
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
export CARGO_HOME="$XDG_DATA_HOME/cargo"
Expand Down
6 changes: 6 additions & 0 deletions config/zsh/plugins.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ local = "~/.config/zsh"
use = ["conda.zsh"]
apply = ["source"]

[plugins.nvm]
inline = """
[ -s "$NVM_DIR/nvm.sh" ] && \
source "$NVM_DIR/nvm.sh" # This loads nvm
"""

####################
# lazy
####################
Expand Down
1 change: 1 addition & 0 deletions scripts/common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"

export DENO_INSTALL="${DENO_INSTALL:-$XDG_DATA_HOME/deno}"
export NVM_DIR="$XDG_DATA_HOME/nvm"
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
export CARGO_HOME="$XDG_DATA_HOME/cargo"
12 changes: 12 additions & 0 deletions scripts/setup-nvm.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -x
# shellcheck source=./scripts/common.bash
source "$(dirname "$0")/common.bash"

echo "Installing nvm..."

if [[ ! -d "$XDG_DATA_HOME/nvm" ]]; then
mkdir -p "$XDG_DATA_HOME/nvm"
fi

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
1 change: 1 addition & 0 deletions scripts/setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ source "$(dirname "$0")/common.bash"
/bin/bash "$CUR_DIR/setup-links.bash"
/bin/bash "$CUR_DIR/setup-deno.bash"
/bin/bash "$CUR_DIR/setup-sheldon.bash"
/bin/bash "$CUR_DIR/setup-nvm.bash"

0 comments on commit b23f11e

Please sign in to comment.