diff --git a/README.md b/README.md index 7ef006a..42c17d2 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Contains: 6. `Inconsolata` font used in PhpStorm, Sublime, `Fira Code` used in iTerm2 7. iTerm2 profile, oh-my-zsh taybalt theme 8. `ssh-manager` command to manage ssh config hosts and keys, including copy public keys to clipboard, transfer to server and more with autocomplete - 9. Packages / CLI (brew, brew cask, dockutil, htop, iftop, openssl, tig, composer, httpie, nmap, php71, git, subversion, node, python3, thefuck, wget, yarn, zsh, zsh-completions) + 9. Packages / CLI (brew, brew cask, dockutil, htop, iftop, openssl, tig, composer, httpie, nmap, php71, git, subversion, nvmm, node, npm, python3, thefuck, wget, yarn, zsh, zsh-completions) 10. Applications (alfred, google-chrome, slack, spotify, sublime-text, vlc, phpstorm, sequel-pro, filezilla, postman, iterm2, teamviewer, lastpass, spectacle, appcleaner, skype) 11. Valet for web development 12. `dotfiles` binary to manage dotfiles functions with autocomplete @@ -29,7 +29,7 @@ Clone and install dotfiles: git clone https://github.com/mihaliak/dotfiles.git ~/dotfiles cd ~/dotfiles - git checkout v3.8 + git checkout v3.9 cd ~/dotfiles/install chmod +wx install.sh chmod -R +wx ~/dotfiles/bin diff --git a/bin/dotfiles b/bin/dotfiles index b32ad14..d122535 100755 --- a/bin/dotfiles +++ b/bin/dotfiles @@ -23,6 +23,7 @@ sub_help () { echo " clean Clean up caches (brew, npm, yarn, composer)" echo " symlinks Run symlinks script" echo " brew Run brew script" + echo " node Run node setup script" echo " valet Run valet script" echo " ohmyzsh Run oh my zsh script" echo " hosts Run hosts script" @@ -57,6 +58,11 @@ sub_brew () { echo -e "${GREEN}$ARROW Success! Brew command finished.${NC}" } +sub_node () { + . "$DOTFILES_DIR/install/node_setup.sh" + echo -e "${GREEN}$ARROW Success! Node setup command finished.${NC}" +} + sub_valet () { . "$DOTFILES_DIR/install/valet.sh" echo -e "${GREEN}$ARROW Success! Valet command finished.${NC}" diff --git a/dots/.exports b/dots/.exports index 238f7f7..9052f19 100644 --- a/dots/.exports +++ b/dots/.exports @@ -1,2 +1,13 @@ export EDITOR=nano -export PATH="$HOME/dotfiles/bin:/usr/local/sbin:$HOME/.config/yarn/global/node_modules/.bin:$HOME/.composer/vendor/bin:/usr/local/bin:/opt/subversion/bin:/usr/local/opt/sqlite/bin:$PATH" + +export NVM_DIR="$HOME/.nvm" + +DOTFILES_EXPORT="$HOME/dotfiles/bin" +LOCAL_BIN_EXPORT="/usr/local/bin" +LOCAL_SBIN_EXPORT="/usr/local/sbin" +YARN_BIN_EXPORT="$HOME/.config/yarn/global/node_modules/.bin" +COMPOSER_BIN_EXPORT="$HOME/.composer/vendor/bin" +SVN_BIN_EXPORT="/opt/subversion/bin" +SQLITE_BIN_EXPORT="/usr/local/opt/sqlite/bin" + +export PATH="$DOTFILES_EXPORT:$LOCAL_BIN_EXPORT:$LOCAL_SBIN_EXPORT:$YARN_BIN_EXPORT:$COMPOSER_BIN_EXPORT:$SVN_BIN_EXPORT:$SQLITE_BIN_EXPORT:$PATH" diff --git a/dots/.extra b/dots/.extra index f4fc2de..7a53a1c 100644 --- a/dots/.extra +++ b/dots/.extra @@ -10,3 +10,5 @@ if [[ "$TERM" == (screen*|xterm*|rxvt*) ]]; then fi compctl -W ~/Code -/ code + +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm \ No newline at end of file diff --git a/install/brew.sh b/install/brew.sh index d7e4497..cc10442 100644 --- a/install/brew.sh +++ b/install/brew.sh @@ -36,11 +36,9 @@ brew install php72-yaml brew install php72-mongodb brew install git brew install subversion -brew install node brew install python3 brew install thefuck brew install wget -brew install yarn brew install zsh brew install zsh-completions brew install webkit2png diff --git a/install/install.sh b/install/install.sh index 6daefe4..c9fc9bd 100755 --- a/install/install.sh +++ b/install/install.sh @@ -4,6 +4,9 @@ # Install composer global packages . "$DOTFILES_DIR/install/composer.sh" +# Install nvm, node, npm, yarn +. "$DOTFILES_DIR/install/node_setup.sh" + # Install npm global packages . "$DOTFILES_DIR/install/yarn.sh" diff --git a/install/node_setup.sh b/install/node_setup.sh new file mode 100644 index 0000000..71eb67b --- /dev/null +++ b/install/node_setup.sh @@ -0,0 +1,9 @@ +export NVM_DIR="$HOME/.nvm" && ( + git clone https://github.com/creationix/nvm.git "$NVM_DIR" + cd "$NVM_DIR" + git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" origin` +) && \. "$NVM_DIR/nvm.sh" + +nvm install --lts --latest-npm + +brew install yarn --without-node \ No newline at end of file diff --git a/install/yarn.sh b/install/yarn.sh index fae4122..8e0c667 100644 --- a/install/yarn.sh +++ b/install/yarn.sh @@ -1,3 +1,2 @@ yarn global add "gulp" -yarn global add "bower" -yarn global add "n" \ No newline at end of file +yarn global add "phantomjs" \ No newline at end of file