Skip to content

Commit

Permalink
feat: add submenu (#3)
Browse files Browse the repository at this point in the history
* feat: add submenu

Add submenu so it will be easy to categorize

* style: remove directory name from list submenui

* fix: coding style

* style: show pass non-namespace

thanks to @rririanto
  • Loading branch information
rririanto authored Apr 22, 2021
1 parent bac9baa commit 42f0332
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions pass.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,22 @@ if (command -v cut && command -v pass)&>/dev/null;then

# location of password-store file
cd ~/.password-store || exit
while IFS= read -r -d '' filename
while IFS= read -r -d '' singelfile
do
filename=${filename:2}
filename=${filename%.*}
echo "${filename} | bash='$0' param1='${filename}' terminal=false"
done < <(find . -type f -name '*.gpg' -print0)
singelfile="${singelfile%.*}"
echo "$(basename "$singelfile") | bash='$0' param1='${singelfile}' terminal=false"
done < <(find "." -maxdepth 1 -type f -name '*.gpg' -print0)

while IFS= read -r -d '' dirname
do
dirname=${dirname:2}
echo "${dirname}"
while IFS= read -r -d '' filename
do
filename="${filename%.*}"
echo "-- $(basename "$filename") | bash='$0' param1='${filename}' terminal=false"
done < <(find "$dirname" -type f -name '*.gpg' -print0)
done < <(find ./* -maxdepth 1 -type d -print0)
else
echo "pass or cut insn't installed, please install"
fi

0 comments on commit 42f0332

Please sign in to comment.