Last active
December 4, 2019 05:19
-
-
Save d3zza/494c799d67c94a3815944e7e84908b1a to your computer and use it in GitHub Desktop.
2019-mac-setup
This file contains hidden or 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
install iterm2, vscode | |
#zsh | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
#show hidden files - select MacHD and press command shift dot | |
#install homebrew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
#install nvm | |
brew install nvm | |
#install yarn | |
brew install yarn | |
#add to ~/.zshrc | |
# exec NVM in every session | |
export NVM_DIR="$HOME/.nvm" | |
. "$(brew --prefix nvm)/nvm.sh" | |
# make nvm use version in .nvmrc automatically | |
autoload -U add-zsh-hook | |
load-nvmrc() { | |
local node_version="$(nvm version)" | |
local nvmrc_path="$(nvm_find_nvmrc)" | |
if [ -n "$nvmrc_path" ]; then | |
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")") | |
if [ "$nvmrc_node_version" = "N/A" ]; then | |
nvm install | |
elif [ "$nvmrc_node_version" != "$node_version" ]; then | |
nvm use | |
fi | |
elif [ "$node_version" != "$(nvm version default)" ]; then | |
echo "Reverting to nvm default version" | |
nvm use default | |
fi | |
} | |
add-zsh-hook chpwd load-nvmrc | |
load-nvmrc | |
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" | |
#sync vs code settings, install settings sync extension | |
#download settings: shift + alt + d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment