]> Sergey Matveev's repositories - schwabrak.git/commitdiff
Strip excess separators for convenience
authorSergey Matveev <stargrave@stargrave.org>
Thu, 21 Aug 2025 06:47:49 +0000 (09:47 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 21 Aug 2025 06:47:49 +0000 (09:47 +0300)
add
metas

diff --git a/add b/add
index 2f097b35a15ba403ef7a9dcbc25151d77773701d675e031ca2abb3fec3baf984..4e7d9f14593df87d15f766f584ab77e35aef4fb0a563419658c5f40554d797ae 100755 (executable)
--- a/add
+++ b/add
@@ -7,6 +7,7 @@ endash() {
 SROOT="$(dirname "$(realpath -- "$0")")"
 fn="$@"
 fn="$(dirname "$fn")/$(basename "$fn" | endash)"
+fn=${fn#./}
 mkdir "$fn"
 echo created: $(date -u +"%Y-%m-%d %H:%M:%S") >"$fn"/meta
 touch "$fn"/about "$fn"/result
diff --git a/metas b/metas
index d90c219d5de235f7e13276cb2005060eb8f26c38dcd2856901b90ab7add99f7f..27f8681815a5957c873aa37d4a6d3e2f4caa6d432704f8f7bc74306c5fe6fe9d 100755 (executable)
--- a/metas
+++ b/metas
@@ -2,6 +2,7 @@
 
 for i in $(find ${1:-.} -type d) ; do
     i=${i#./}
+    i=${i%/}
     [ -s $i/meta ] || continue
     echo id: $i
     echo name: $i | ${PERL:-perl} -npe 's/([^-])-([^-])/$1 $2/g ; s/-(-+)/$1/g'