summaryrefslogtreecommitdiff
path: root/bin/extra/curszip
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-10-15 00:33:26 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-10-15 00:33:26 +0200
commit826ce094fecc4c6e07faf6e8b91387c2ae49842c (patch)
tree1820c843e4e260f6b51e8d269a972295a17e558c /bin/extra/curszip
parentc032a9d071ee4b7eb2bfe79ec03d2a7dc4020f15 (diff)
parenta915b5ade1a47b9678e2f9963b13b49dbd406031 (diff)
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/extra/curszip')
-rwxr-xr-xbin/extra/curszip17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/extra/curszip b/bin/extra/curszip
new file mode 100755
index 0000000..6ab99e8
--- /dev/null
+++ b/bin/extra/curszip
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+list1() { find "$1" -mindepth 1 -maxdepth 1 -type "${2:-d}" -printf '%f\n'; }
+
+curs="$(list1 ~/docs/school/Vakken | fzf)"
+[ "$curs" ] || exit 1
+zip="$(list1 ~/dl f | fzf -f "$curs" | grep '\.zip$')"
+[ "$zip" ] || exit 1
+
+>&2 printf "zip: %s\n" "$zip"
+
+cd -- ~/docs/school/Vakken/"$curs" || exit 1
+rm -rf Cursus
+mv -- ~/dl/"$zip" .
+unzip -- "./$zip"
+mv -- "${zip%%.zip}" Cursus
+rm -- "$zip"