1
0
Fork 0

check if project name was empty

This commit is contained in:
Andrey Listopadov 2021-02-26 18:40:07 +03:00
parent cce440353e
commit ce97b7efa9

View file

@ -34,6 +34,7 @@ define-command -hidden fzf-project %{ evaluate-commands %sh{
}}
define-command -hidden fzf-save-path-as-project %{ prompt -shell-script-candidates %{printf "%s\n" "${PWD##*/}"} "Project's name: " %{ evaluate-commands %sh{
if [ -n "${kak_text}" ]; then
mkdir -p "${kak_opt_fzf_project_file%/*}"
exists=$(grep "${kak_text}: " ${kak_opt_fzf_project_file})
if [ -z "${exists}" ]; then
@ -43,6 +44,9 @@ define-command -hidden fzf-save-path-as-project %{ prompt -shell-script-candidat
else
printf "%s\n" "fzf-project-confirm-impl %{Project '${kak_text}' exists. Update? (y/N): } %{fzf-update-project-path-impl %{${kak_text}} %{${PWD}}} %{Project '${kak_text}' updated} %{Project '${kak_text}' kept}"
fi
else
printf "%s\n" "echo -markup %{{Error} Project name can't be empty}"
fi
}}}
define-command -hidden fzf-save-path-as-project-no-prompt %{ evaluate-commands %sh{