summaryrefslogtreecommitdiff
path: root/cards.sh
diff options
context:
space:
mode:
authorhmjsp <hmjsp@liber8bits.com>2025-07-06 23:07:38 +0100
committerhmjsp <hmjsp@liber8bits.com>2025-07-06 23:07:38 +0100
commit65542546a50e08ad0cf55ad2af6f4b00edf02296 (patch)
treed2c5f630b79aaa299d8922f7584a406d15c00672 /cards.sh
parent840033234febf09e2367af270ab7a0821fd3d0e5 (diff)
downloadflashot-65542546a50e08ad0cf55ad2af6f4b00edf02296.zip
first proper version
- use hyphens only for separation - only two scripts: one for screenshots and one for making the cards - add README - a little bit of error checking - TODO: if question or answer non existent, then don't break cards.txt
Diffstat (limited to 'cards.sh')
-rwxr-xr-xcards.sh22
1 files changed, 0 insertions, 22 deletions
diff --git a/cards.sh b/cards.sh
deleted file mode 100755
index 7df324e..0000000
--- a/cards.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-# file prefixes cant have underscores or dashes in their names
-if [ $(ls cards.txt) ]; then
- rm cards.txt
-fi
-
-for name in $(ls *.png | cut -d- -f1 | uniq); do
- old_card=-1
- for file in "$name"*; do
- echo "file = $file"
- card=$(echo "$file" | cut -d_ -f2 | cut -d- -f1)
- echo "card = $card"
- if [[ "$card" = "$old_card" ]]
- then
- echo "$file\"/>;Card_$card" >> cards.txt
- else
- # TODO: use printf as echo -n is not portable
- /bin/echo -n "<img src=\"$file\"/>;<img src=\"" >> cards.txt
- fi
- old_card=$card
- done
-done