diff --git a/activator.bindings.zsh b/activator.bindings.zsh index 294fcad..b81df4d 100644 --- a/activator.bindings.zsh +++ b/activator.bindings.zsh @@ -10,7 +10,7 @@ || return 0 _CA__ZSH_SHORTCUT_PLUGIN() { - local OPTIONS=(clone new $(_CA_LIST)) + local OPTIONS=($(_CA_GET_LIST)) [ $_CA_ENV ] && OPTIONS=(deactivate $OPTIONS) local SELECTION=$(echo $OPTIONS | _CA_MULTILINE | _CA_FZF 'select a project') diff --git a/activator.completion.zsh b/activator.completion.zsh index 1b13e42..1acb820 100644 --- a/activator.completion.zsh +++ b/activator.completion.zsh @@ -11,7 +11,7 @@ _CA__PROJECT_COMPADD() { _describe 'commands' DESCRIPTIONS - compadd -- $(_CA_LIST) + compadd -- $(_CA_GET_LIST) } ##################################################################### diff --git a/global.zsh b/global.zsh index 815f913..ce3daf7 100644 --- a/global.zsh +++ b/global.zsh @@ -22,14 +22,14 @@ _CA_MULTILINE() { sed 's/\s\+/\n/g'; } _CA_LIST() { local base_dir PROJECTS=() - { - for base_dir in $CA__DIRS + for base_dir in $CA__DIRS + do + [ ! -d $base_dir ] && continue + for project_dir in $(find "$base_dir" -mindepth 1 -maxdepth 1 \( -type d -o -type l \) ) do - [ ! -d $base_dir ] && continue - { cd $base_dir; ls -d *; } \ - | awk '{print "'$(basename $base_dir)/'"$1;}' + echo $(basename $base_dir)/$(basename $project_dir) done - } + done } ##################################################################### diff --git a/zsh/list.zsh b/zsh/list.zsh new file mode 100644 index 0000000..9e033f2 --- /dev/null +++ b/zsh/list.zsh @@ -0,0 +1,3 @@ +_CA_GET_LIST() { + echo "clone new $(_CA_LIST)" | sed 's/ /\n/g' +}