diff --git a/apps/site/snippets/en/download/brew.bash b/apps/site/snippets/en/download/brew.bash index 96c16ac6bd083..3b2c5193f5b82 100644 --- a/apps/site/snippets/en/download/brew.bash +++ b/apps/site/snippets/en/download/brew.bash @@ -1,5 +1,21 @@ -# Download and install Homebrew -curl -o- https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | bash +# Download and install Homebrew: +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + +# Add Homebrew to your PATH: +${props.os === 'MAC' ? + `if [ -x /opt/homebrew/bin/brew ]; then + eval "$(/opt/homebrew/bin/brew shellenv)" + grep -qs '/opt/homebrew/bin/brew shellenv' ~/.zprofile ~/.zshrc || { echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"'; } >> ~/.zprofile +fi` : + `if [ -x /home/linuxbrew/.linuxbrew/bin/brew ]; then + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + grep -qs '/home/linuxbrew/.linuxbrew/bin/brew shellenv' ~/.bashrc ~/.profile || { echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"'; } >> ~/.bashrc +fi` +} # Download and install Node.js: brew install node@${props.release.major} + +# Add Node.js to your PATH (required for keg-only LTS formulas): +export PATH="$(brew --prefix node@${props.release.major})/bin:$PATH" +grep -qs "$(brew --prefix node@${props.release.major})/bin" ${props.os === 'MAC' ? '~/.zshrc' : '~/.bashrc'} || { echo; echo 'export PATH="'"$(brew --prefix node@${props.release.major})/bin"':$PATH"'; } >> ${props.os === 'MAC' ? '~/.zshrc' : '~/.bashrc'} diff --git a/apps/site/snippets/en/download/fnm.bash b/apps/site/snippets/en/download/fnm.bash index ab27a1ad68cf0..f60be19d68a54 100644 --- a/apps/site/snippets/en/download/fnm.bash +++ b/apps/site/snippets/en/download/fnm.bash @@ -1,13 +1,17 @@ # Download and install fnm: ${props.os === 'WIN' ? 'winget install Schniz.fnm' : - 'curl -o- https://fnm.vercel.app/install | bash' + props.os === 'MAC' ? + 'curl -o- https://fnm.vercel.app/install | bash -s -- --force-no-brew' : + 'curl -o- https://fnm.vercel.app/install | bash' } # In lieu of restarting the shell ${props.os === 'WIN' ? 'fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression' : - 'export PATH="$HOME/.local/share/fnm:$PATH"\neval "$(fnm env)"' + props.os === 'MAC' ? + 'export PATH="$HOME/Library/Application Support/fnm:$PATH"\neval "$(fnm env)"' : + 'export PATH="$HOME/.local/share/fnm:$PATH"\neval "$(fnm env)"' } # Download and install Node.js: diff --git a/apps/site/snippets/en/download/n.bash b/apps/site/snippets/en/download/n.bash index 6de7abe3d79bb..42bdbbca88595 100644 --- a/apps/site/snippets/en/download/n.bash +++ b/apps/site/snippets/en/download/n.bash @@ -1,5 +1,9 @@ # Download and install n and Node.js: curl -fsSL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s ${props.release.major} +# In lieu of restarting the shell: +export N_PREFIX="$HOME/n" +export PATH="$N_PREFIX/bin:$PATH" + # Node.js already installs during n-install, but you can also install it manually: # n install ${props.release.major} diff --git a/apps/site/snippets/en/download/zeroinstall.bash b/apps/site/snippets/en/download/zeroinstall.bash index a8e51a5044156..63b794c5fdeb7 100644 --- a/apps/site/snippets/en/download/zeroinstall.bash +++ b/apps/site/snippets/en/download/zeroinstall.bash @@ -1,5 +1,5 @@ # Get 0install: -${props.os === 'WIN' ? 'winget install 0install' : 'curl -O https://get.0install.net/0install.sh && chmod +x 0install.sh\n./0install.sh\nexport PATH=$HOME/bin:$PATH'} +${props.os === 'WIN' ? 'winget install 0install' : 'curl -O https://get.0install.net/0install.sh && chmod +x 0install.sh\n./0install.sh install home\nexport PATH=$HOME/bin:$PATH'} # Add Node.js and npm to PATH: 0install add node https://apps.0install.net/javascript/node.xml --version=${props.release.version}