diff options
| author | not_a_robot06 <temporarythrowaway@tutamail.com> | 2025-07-07 17:01:32 +0100 |
|---|---|---|
| committer | not_a_robot06 <temporarythrowaway@tutamail.com> | 2025-07-07 17:01:32 +0100 |
| commit | 5a1dd2e15de2151e29edbc7949f3ddcbbba3e3b3 (patch) | |
| tree | 9f38149ec1394705ea95f0c2b7bcd074363fee07 /flashot.sh | |
| parent | be35de785e659cc080dd902cf296b5ce270e2e3f (diff) | |
| download | flashot-5a1dd2e15de2151e29edbc7949f3ddcbbba3e3b3.tar.gz flashot-5a1dd2e15de2151e29edbc7949f3ddcbbba3e3b3.tar.bz2 flashot-5a1dd2e15de2151e29edbc7949f3ddcbbba3e3b3.zip | |
fix README, suppress errors that are irrelevant
Diffstat (limited to 'flashot.sh')
| -rwxr-xr-x | flashot.sh | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1,7 +1,12 @@ #!/bin/sh mkdir -p /tmp/flashot -photoname=$(ls /tmp/flashot | cut -d- -f1 | uniq | dmenu -i -p "name of screenshots? (no hyphens)") +if [ -d /tmp/flashot ]; then + photoname=$(ls /tmp/flashot | cut -d- -f1 | uniq | dmenu -i -p "name of screenshots? (no hyphens)") +else + photoname=$(dmenu -i -p "name of screenshots? (no hyphens)") +fi + case "$photoname" in *-* ) printf "ok" | dmenu -p "not a valid name (no hyphens!)" @@ -13,7 +18,7 @@ case "$photoname" in ;; esac -photonumber=$(basename -a $(ls /tmp/flashot/"$photoname"*) | cut -d- -f2 | uniq | tac | dmenu -i -p "number?") +photonumber=$(basename -a $(ls /tmp/flashot/"$photoname"* 2>/dev/null) 2>/dev/null | cut -d- -f2 | uniq | tac | dmenu -i -p "number?") type=$(printf "question\nanswer" | dmenu -i -p "question or answer?") if [ "$type" = "question" ]; then @@ -22,7 +27,7 @@ else type=a fi -partnumber=$(ls /tmp/flashot/"$photoname"-"$photonumber"-"$type"-* | tail -n1 | cut -d- -f4 | cut -d. -f1) +partnumber=$(ls /tmp/flashot/"$photoname"-"$photonumber"-"$type"-* 2>/dev/null | tail -n1 | cut -d- -f4 | cut -d. -f1) if [ -z "$partnumber" ]; then partnumber=0 else |
