-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
set -e | ||
|
||
# Define NVM_DIR and source the nvm.sh setup script | ||
[ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm" | ||
|
||
if [[ -s "$HOME/.nvm/nvm.sh" ]]; then | ||
. "$HOME/.nvm/nvm.sh" | ||
elif [[ -x "$(command -v brew)" && -s "$(brew --prefix nvm)/nvm.sh" ]]; then | ||
. "$(brew --prefix nvm)/nvm.sh" | ||
fi | ||
|
||
# Set up the nodenv node version manager if present | ||
if [[ -x "$HOME/.nodenv/bin/nodenv" ]]; then | ||
eval "$("$HOME/.nodenv/bin/nodenv" init -)" | ||
elif [[ -x "$(command -v brew)" && -x "$(brew --prefix nodenv)/bin/nodenv" ]]; then | ||
eval "$("$(brew --prefix nodenv)/bin/nodenv" init -)" | ||
fi | ||
|
||
# Set up the ndenv of anyenv if preset | ||
if [[ ! -x node && -d ${HOME}/.anyenv/bin ]]; then | ||
export PATH=${HOME}/.anyenv/bin:${PATH} | ||
if [[ "$(anyenv envs | grep -c ndenv )" -eq 1 ]]; then | ||
eval "$(anyenv init -)" | ||
fi | ||
fi |