From 026be42a65265129adda1fba3d69b19cc2e99c12 Mon Sep 17 00:00:00 2001 From: codepuncher Date: Fri, 13 Feb 2026 14:20:30 +0000 Subject: [PATCH] fix(setup): setup node and corepack --- setup.sh | 3 --- shell/functions | 24 ++++++++++++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/setup.sh b/setup.sh index f126ecc..0585019 100755 --- a/setup.sh +++ b/setup.sh @@ -1,8 +1,5 @@ #!/usr/bin/env bash -# Set "strict mode" -set -euo pipefail - SCRIPT_PATH=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) if [[ -f "${SCRIPT_PATH}/shell/functions" ]]; then source "${SCRIPT_PATH}/shell/functions" diff --git a/shell/functions b/shell/functions index 5034631..0fa111d 100644 --- a/shell/functions +++ b/shell/functions @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Set "strict mode" -set -euo pipefail +# set -euo pipefail section_start() { printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - @@ -227,11 +227,23 @@ setup_arch_services() { install_nvm() { section_start 'Installing NVM' # shellcheck disable=SC2155 - export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.config/nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" && - mkdir -p "${NVM_DIR}" && - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash - - corepack enable + export NVM_DIR="$( + [ -z "${XDG_CONFIG_HOME-}" ] + printf %s "${HOME}/.config/nvm" || printf %s "${XDG_CONFIG_HOME}/nvm" + )" + mkdir -p "${NVM_DIR}" + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash + + # Load NVM after installing it. + [ -s "${NVM_DIR}/nvm.sh" ] && \."${NVM_DIR}/nvm.sh" # This loads nvm + + nvm install --lts + nvm use --lts + nvm alias default node + + if command -v corepack >/dev/null 2>&1; then + corepack enable + fi } install_rustup() {