Introduction
Introduction Statistics Contact Development Disclaimer Help
dir2memeblob: reuse dir2meme and zip in one call - brcon2023-hackathons - Bitre…
git clone git://bitreich.org/brcon2023-hackathons git://enlrupgkhuxnvlhsf6lc3fz…
Log
Files
Refs
Tags
---
commit 11fa54e26dd5fffdccc62745a9550545b9c06a88
parent 08ed11b8a559da2751e6e348da949d01ac4353ec
Author: Anders Damsgaard <[email protected]>
Date: Sat, 12 Aug 2023 18:37:36 +0200
dir2memeblob: reuse dir2meme and zip in one call
Signed-off-by: Christoph Lohmann <[email protected]>
Diffstat:
M memes/dir2memeblob | 27 ++++++---------------------
1 file changed, 6 insertions(+), 21 deletions(-)
---
diff --git a/memes/dir2memeblob b/memes/dir2memeblob
@@ -9,25 +9,10 @@ fi
memefile="$1"
outname="${memefile%.*}"
outzip="${outname}.meme.blob.zip"
-
-[ ! -e "${memefile}" ] && printf "meme\n" > ${memefile}
-find . -type f \
-| while read -r medianame;
-do
- case "${medianame}" in
- *.meme|*.memeblob.*)
- continue
- ;;
- esac
-
- filename="$(basename "${medianame}")"
- memetag="${filename%.*}"
- [ ! -e "${memefile}" ] && printf "#%s %s\n" "${memetag}" "${filename}"…
- zip -u "${outzip}" "${filename}"
-done
-
-zip -u "${outzip}" "${memefile}"
-rm "${memefile}"
-
+[ ! -e "${memefile}" ] && sh ./dir2meme >"${memefile}"
+if [ "$(uname)" = OpenBSD ]
+then
+ zipflag=-f
+fi
+zip $zipflag "${outzip}" $(awk 'NR>1 {printf "%s ", $2}' "${memefile}") "${mem…
printf "%s\n" "${outzip}"
-
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.