Summary Files Commits Branches @commit @diff @stats
path: root / generate-hooks / make-file-lists.sh
diff options
context:
space:
mode:
Commit62daf522a1e51c4a1d9d8b31d2a0093da86ebc5d (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-09-28 17:15:36 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-09-29 17:40:09 +0300
Files7474bc314afde18b6e53bb6702f54a04c5a87ed1 /generate-hooks/make-file-lists.sh
syndamia.com-62daf522a1e51c4a1d9d8b31d2a0093da86ebc5d.tar
syndamia.com-62daf522a1e51c4a1d9d8b31d2a0093da86ebc5d.tar.gz
syndamia.com-62daf522a1e51c4a1d9d8b31d2a0093da86ebc5d.zip
Parenta8b5c3c03b37ebf90e7ee8c9cb7c8f913f50c79a (diff)
[hooks] Reworked all hooks to use awk for their logic
1 files changed, 3 insertions, 7 deletions
-rwxr-xr-xgenerate-hooks/make-file-lists.sh10
diff --git a/generate-hooks/make-file-lists.sh b/generate-hooks/make-file-lists.sh
index e407e19..87d8e61 100755
--- a/generate-hooks/make-file-lists.sh
+++ b/generate-hooks/make-file-lists.sh
@@ -53,12 +53,8 @@ if [ -z "$1" ]; then
exit
fi
+awkloc="$(dirname "$0")/create-file-lists.awk"
+
for file in $1; do
- sed -i 's/&#38;&#38;nos$/<table class="file-list"><tr>/g;
- s/^<p>&#38;&#38;fos$/<details class="file-wrapper"><summary>/g;
- s/^&#38;&#38;fs0$/<\/summary><table class="file-list"><tr>/g;
- s/^&#38;&#38;fs$/<\/tr><tr>/g;
- s/^&#38;&#38;nod<\/p>$/<\/tr><\/table>/g;
- s/^&#38;&#38;fod<\/p>$/<\/tr><\/table><\/details>/g' \
- "$file"
+ awk -f "$awkloc" $file > tmp && mv -f tmp $file
done