fish: update ghq_rm function to use the new 'rm' subcommand of ghq
Present in ghq v1.5.0
This commit is contained in:
parent
a1a400a765
commit
ac32f4d838
|
@ -1,18 +1,10 @@
|
|||
function ghq_rm
|
||||
set -l projects (ghq list --exact | fzf \
|
||||
--multi \
|
||||
--prompt "Project: " \
|
||||
--preview 'lsd -1FAL --group-dirs first --icon always --color always {}' \
|
||||
)
|
||||
set -l projects (ghq list --exact | fzf --multi --prompt "Project: ")
|
||||
|
||||
if test -n "$projects"
|
||||
for proj in $projects
|
||||
read -l -P (printf "Delete project \033[1;33m$proj\033[0m? [y/N]") confirm
|
||||
if test "$confirm" = "y"
|
||||
set -l proj_dir (ghq list --full-path "$proj")
|
||||
rm -rf "$proj_dir"
|
||||
rmdir -p --ignore-fail-on-non-empty (dirname "$proj_dir")
|
||||
end
|
||||
set -l proj_dir (ghq list --full-path "$proj")
|
||||
ghq rm "$proj"; and rmdir -p --ignore-fail-on-non-empty (dirname "$proj_dir")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue