check if project name was empty
This commit is contained in:
parent
cce440353e
commit
ce97b7efa9
1 changed files with 11 additions and 7 deletions
|
@ -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{
|
||||
|
|
Loading…
Reference in a new issue