Last active
          August 29, 2015 14:21 
        
      - 
      
- 
        Save orzFly/dd4e7675f69df45c7e23 to your computer and use it in GitHub Desktop. 
Revisions
- 
        orzFly renamed this gist May 15, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ #!/usr/bin/env zsh nb() { local npmbin="`npm bin`" if [ ! -d "$npmbin" ]; then @@ -10,8 +12,6 @@ nb() { } _nb() { _arguments -C \ '1: :->cmds' \ '*:: :->args' && ret=0 
- 
        orzFly created this gist May 15, 2015 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ nb() { local npmbin="`npm bin`" if [ ! -d "$npmbin" ]; then echo "NB is not available at $npmbin" return 1 fi local command="$1" builtin shift 1 "$npmbin/$command" $* } _nb() { local curcontext="$curcontext" state line _gems _opts ret=1 _arguments -C \ '1: :->cmds' \ '*:: :->args' && ret=0 case $state in cmds) local npmbin="`npm bin`" if [ ! -d "$npmbin" ]; then return 1 fi _path_files -W "$npmbin" ret=0 ;; args) _normal && ret=0 ;; esac return ret } compdef _nb nb