diff options
| author | hmjsp <hmjsp@liber8bits.com> | 2025-07-07 17:01:32 +0100 |
|---|---|---|
| committer | hmjsp <hmjsp@liber8bits.com> | 2025-07-07 17:01:32 +0100 |
| commit | 7440ea6ee939d6ae74b8ff5f7548bab2556f588b (patch) | |
| tree | 9f38149ec1394705ea95f0c2b7bcd074363fee07 /flashot.sh | |
| parent | 65542546a50e08ad0cf55ad2af6f4b00edf02296 (diff) | |
| download | flashot-7440ea6ee939d6ae74b8ff5f7548bab2556f588b.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 |
