Skip to content

Instantly share code, notes, and snippets.

View lourenzo's full-sized avatar

Lourenzo Ferreira lourenzo

View GitHub Profile
@lourenzo
lourenzo / yo-completion.sh
Last active August 29, 2015 14:21 — forked from natchiketa/yo-completion.sh
Added nodebrew support
# Bash completion for Yeoman generators - tested in Ubuntu, OS X and Windows (using Git bash)
function _yo_generator_complete_() {
# local node_modules if present
local local_modules=$(if [ -d node_modules ]; then echo "node_modules:"; fi)
# node_modules in /usr/local/lib if present
local usr_local_modules=$(if [ -d /usr/local/lib/node_modules ]; then echo "/usr/local/lib/node_modules:"; fi)
# node_modules in user's Roaming/npm (Windows) if present
local win_roam_modules=$(if [ -d $(which yo)/../node_modules ]; then echo "$(which yo)/../node_modules:"; fi)
# also, node_modules in nodebrew current
local nodebrew_modules=$(if [ -d ${HOME}/.nodebrew/current/lib/node_modules ]; then echo "${HOME}/.nodebrew/current/lib/node_modules:"; fi)