Skip to content

Commit

Permalink
Node setup - using nvm
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaliak committed Mar 2, 2018
1 parent 29c94f5 commit c5b6234
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions bin/dotfiles
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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}"
Expand Down
13 changes: 12 additions & 1 deletion dots/.exports
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 2 additions & 0 deletions dots/.extra
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions install/brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
9 changes: 9 additions & 0 deletions install/node_setup.sh
Original file line number Diff line number Diff line change
@@ -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
3 changes: 1 addition & 2 deletions install/yarn.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
yarn global add "gulp"
yarn global add "bower"
yarn global add "n"
yarn global add "phantomjs"

0 comments on commit c5b6234

Please sign in to comment.