exit on ESC

This commit is contained in:
Rasmus Steinke 2015-10-15 09:54:28 +02:00
parent 49db6fce05
commit 8eef49fd4f
2 changed files with 6 additions and 2 deletions

View File

@ -58,8 +58,10 @@ printEntry () {
done
}
if [[ "$group" == "No Group" || "$group" == "" ]]; then
if [[ "$group" == "No Group" ]]; then
printEntry | PASSWORD_STORE_DIR="${root}" pass insert -m "${Name}"
elif [[ "$group" == "" ]]; then
exit
else
printEntry | PASSWORD_STORE_DIR="${root}" pass insert -m "${group}/${Name}"
fi

View File

@ -304,8 +304,10 @@ insertPass () {
elif [[ $insertmenu == "* Accept Values and Add Password Entry" ]]; then
cd "${root}"
group=$(echo -e "No Group\n---\n$(find -type d -not -iwholename '*.git*' -printf '%d\t%P\n' | sort -r -nk1 | cut -f2-)" | _rofi -dmenu -p "Choose Group > ")
if [[ "$group" == "No Group" || "$group" == "" ]]; then
if [[ "$group" == "No Group" ]]; then
PASSWORD_STORE_DIR="${root}" pass insert -m -f "${name}" < <(echo -e "${pass}\nUserName: ${user}\n---\n${URL_field}: ${domain}")
elif [[ "$group" == "" ]]; then
exit
else
PASSWORD_STORE_DIR="${root}" pass insert -m -f "${group}/${name}" < <(echo -e "${pass}\nUserName: ${user}\n---\n${URL_field}: ${domain}")
fi