[BUGFIX] fixed duplicate function name and resolve symlinks again

This commit is contained in:
Wryn (yage) Wagner 2023-06-27 16:52:46 -06:00
parent 854e69c134
commit 3b60a916f0
4 changed files with 11 additions and 8 deletions

View File

@ -10,7 +10,7 @@
|| return 0 || return 0
_CA__ZSH_SHORTCUT_PLUGIN() { _CA__ZSH_SHORTCUT_PLUGIN() {
local OPTIONS=(clone new $(_CA_LIST)) local OPTIONS=($(_CA_GET_LIST))
[ $_CA_ENV ] && OPTIONS=(deactivate $OPTIONS) [ $_CA_ENV ] && OPTIONS=(deactivate $OPTIONS)
local SELECTION=$(echo $OPTIONS | _CA_MULTILINE | _CA_FZF 'select a project') local SELECTION=$(echo $OPTIONS | _CA_MULTILINE | _CA_FZF 'select a project')

View File

@ -11,7 +11,7 @@ _CA__PROJECT_COMPADD() {
_describe 'commands' DESCRIPTIONS _describe 'commands' DESCRIPTIONS
compadd -- $(_CA_LIST) compadd -- $(_CA_GET_LIST)
} }
##################################################################### #####################################################################

View File

@ -22,14 +22,14 @@ _CA_MULTILINE() { sed 's/\s\+/\n/g'; }
_CA_LIST() { _CA_LIST() {
local base_dir PROJECTS=() 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 do
[ ! -d $base_dir ] && continue echo $(basename $base_dir)/$(basename $project_dir)
{ cd $base_dir; ls -d *; } \
| awk '{print "'$(basename $base_dir)/'"$1;}'
done done
} done
} }
##################################################################### #####################################################################

3
zsh/list.zsh Normal file
View File

@ -0,0 +1,3 @@
_CA_GET_LIST() {
echo "clone new $(_CA_LIST)" | sed 's/ /\n/g'
}