Fix detect no entries to show

This commit is contained in:
q3aql 2022-06-26 14:10:53 +02:00
parent bb4ce9a7b7
commit e4a46a5e7c
3 changed files with 154 additions and 130 deletions

View File

@ -635,6 +635,10 @@ function list_entries_vault() {
if [ ${list_notes_count} -ne 0 ] ; then if [ ${list_notes_count} -ne 0 ] ; then
process_extracted_vault_notes process_extracted_vault_notes
fi fi
if [ ${total_count_vaults} -eq 0 ] ; then
echo ""
echo "# No Entries to Show"
fi
echo "" echo ""
echo -n "# Press enter key to continue " ; read enter_continue echo -n "# Press enter key to continue " ; read enter_continue
} }
@ -758,9 +762,13 @@ function remove_entry_vault() {
echo " * bcard/${card}" echo " * bcard/${card}"
done done
fi fi
if [ ${count_total} -ne 0 ] ; then if [ ${count_total} -eq 0 ] ; then
echo "# No Entries to Show"
echo "" echo ""
echo -n "# Press enter key to continue " ; read enter_continue
pwsh_vault_main
fi fi
echo ""
echo -n "# Type entry to remove (Default: Return): " ; read vault_remove_entry echo -n "# Type entry to remove (Default: Return): " ; read vault_remove_entry
if [ -z "${vault_remove_entry}" ] ; then if [ -z "${vault_remove_entry}" ] ; then
echo "# Canceled Remove Entry" echo "# Canceled Remove Entry"
@ -818,9 +826,13 @@ function edit_entry_vault() {
echo " * bcard/${card}" echo " * bcard/${card}"
done done
fi fi
if [ ${count_total} -ne 0 ] ; then if [ ${count_total} -eq 0 ] ; then
echo "# No Entries to Show"
echo "" echo ""
echo -n "# Press enter key to continue " ; read enter_continue
pwsh_vault_main
fi fi
echo ""
echo -n "# Type entry to edit (Default: Return): " ; read vault_edit_entry echo -n "# Type entry to edit (Default: Return): " ; read vault_edit_entry
if [ -z "${vault_edit_entry}" ] ; then if [ -z "${vault_edit_entry}" ] ; then
echo "# Canceled Edit Entry" echo "# Canceled Edit Entry"

View File

@ -610,6 +610,10 @@ function list_entries_vault() {
count=$(expr ${count} + 1) count=$(expr ${count} + 1)
done done
fi fi
if [ ${total_count_vaults} -eq 0 ] ; then
dialog --title "# pwsh-vault-dl ${VERSION} $(generate_spaces 20)" --msgbox "# No Entries to Show" 0 0
pwsh_vault_main
fi
echo "${list_entries_vault_dl}" > ${pwsh_vault_cache_temp} echo "${list_entries_vault_dl}" > ${pwsh_vault_cache_temp}
bash ${pwsh_vault_cache_temp} bash ${pwsh_vault_cache_temp}
read pepe read pepe

View File

@ -786,6 +786,9 @@ function remove_entry_vault() {
count_notes=$(ls -1 ${pwsh_vault}/notes/ | wc -l) count_notes=$(ls -1 ${pwsh_vault}/notes/ | wc -l)
count_bcard=$(ls -1 ${pwsh_vault}/bcard/ | wc -l) count_bcard=$(ls -1 ${pwsh_vault}/bcard/ | wc -l)
count_total=$(expr ${count_logins} + ${count_notes} + ${count_bcard}) count_total=$(expr ${count_logins} + ${count_notes} + ${count_bcard})
if [ ${count_total} -eq 0 ] ; then
echo > /dev/null | pwsh-vaultm -p " No Entries to Show $(generate_spaces 70)"
else
vault_remove_entry=$(list_folders_pwsh_vault | pwsh-vaultm -p " Remove Entry (${count_total}):") vault_remove_entry=$(list_folders_pwsh_vault | pwsh-vaultm -p " Remove Entry (${count_total}):")
vault_remove_entry=$(echo ${vault_remove_entry} | cut -c5-999) vault_remove_entry=$(echo ${vault_remove_entry} | cut -c5-999)
if [ -z "${vault_remove_entry}" ] ; then if [ -z "${vault_remove_entry}" ] ; then
@ -805,6 +808,7 @@ function remove_entry_vault() {
remove_entry_vault remove_entry_vault
fi fi
fi fi
fi
} }
function edit_entry_vault() { function edit_entry_vault() {
@ -812,6 +816,9 @@ function edit_entry_vault() {
count_notes=$(ls -1 ${pwsh_vault}/notes/ | wc -l) count_notes=$(ls -1 ${pwsh_vault}/notes/ | wc -l)
count_bcard=$(ls -1 ${pwsh_vault}/bcard/ | wc -l) count_bcard=$(ls -1 ${pwsh_vault}/bcard/ | wc -l)
count_total=$(expr ${count_logins} + ${count_notes} + ${count_bcard}) count_total=$(expr ${count_logins} + ${count_notes} + ${count_bcard})
if [ ${count_total} -eq 0 ] ; then
echo > /dev/null | pwsh-vaultm -p " No Entries to Show $(generate_spaces 70)"
else
vault_edit_entry=$(list_folders_pwsh_vault | pwsh-vaultm -p " Edit Entry (${count_total}):") vault_edit_entry=$(list_folders_pwsh_vault | pwsh-vaultm -p " Edit Entry (${count_total}):")
vault_edit_entry=$(echo ${vault_edit_entry} | cut -c5-999) vault_edit_entry=$(echo ${vault_edit_entry} | cut -c5-999)
if [ -z "${vault_edit_entry}" ] ; then if [ -z "${vault_edit_entry}" ] ; then
@ -931,6 +938,7 @@ function edit_entry_vault() {
edit_entry_vault edit_entry_vault
fi fi
fi fi
fi
} }
function search_entries_menu_show() { function search_entries_menu_show() {