Skip to content

Instantly share code, notes, and snippets.

@leeadkins
leeadkins / gist:3809218
Created October 1, 2012 02:52
Super simple hack to automatically switch to a specific Node version on CD (using NVM and ZSH)
# Detects if a .nvmrc file exists, and switches
# to the specified version if it does.
# The contents of the .nvmrc file should simply be the node
# version to use, like "v0.8.11"
# Put this in your .zshrc file or somewhere else that is loaded automatically
function chpwd() {
emulate -L zsh
if [[ -f .nvmrc ]] then
nvm use `cat .nvmrc`
fi