Skip to content

Instantly share code, notes, and snippets.

@mythmon
Created June 11, 2014 00:45
Show Gist options
  • Save mythmon/e990e0d57b6293fd7637 to your computer and use it in GitHub Desktop.
Save mythmon/e990e0d57b6293fd7637 to your computer and use it in GitHub Desktop.
My venver .venv
#!/bin/bash
DIR=$(dirname $0)
v_activate() {
_OLD_PS1="$PS1"
export PS1="(venver)$PS1"
_OLD_PATH="$PATH"
export PATH="node_modules/.bin:$PATH"
r() {
npm start
}
s() {
node
}
t() {
npm test
}
}
v_deactivate() {
PATH=$_OLD_PATH
unset _OLD_PATH
PS1=$_OLD_PS1
unset _OLD_PS1
PATH=$_OLD_PATH
unset _OLD_PATH
unfunction r
unfunction s
unfunction t
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment