2015-02-21 05:35:49 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
cleanup () { unalias foo; unalias grep; }
|
2016-11-07 03:34:36 +08:00
|
|
|
die () { echo "$@" ; cleanup ; exit 1; }
|
2015-02-21 05:35:49 +08:00
|
|
|
|
2016-11-04 13:15:18 +08:00
|
|
|
\. ../../../nvm.sh
|
2015-02-21 05:35:49 +08:00
|
|
|
|
|
|
|
alias foo='bar'
|
|
|
|
nvm_is_alias foo || die '"nvm_is_alias foo" was not true'
|
|
|
|
|
|
|
|
! nvm_is_alias nvm_is_alias || die '"nvm_is_alias nvm_is_alias was not false'
|
|
|
|
|
|
|
|
alias grep='grep'
|
|
|
|
unalias grep || die '"unalias grep" failed'
|
|
|
|
! nvm_is_alias grep || die '"nvm_is_alias grep" with unaliased grep was not false'
|
|
|
|
|
|
|
|
alias grep='grep'
|
|
|
|
nvm_is_alias grep || die '"nvm_is_alias grep" with aliased grep was not true'
|
|
|
|
|
|
|
|
cleanup
|