aboutsummaryrefslogtreecommitdiff
path: root/c2x
diff options
context:
space:
mode:
authorInqiyad Sabr <sabr@ariamath.xyz>2025-11-18 02:28:26 +0600
committerInqiyad Sabr <sabr@ariamath.xyz>2025-11-18 02:28:26 +0600
commit082013998723b3f7d4051d48a8da828494f360df (patch)
treeb5265f68c14d5b275802aa0ffa17e778672e401e /c2x
parentb310fce41b551a12eb59e7348878f6069b8351f1 (diff)
Fixing creation of duplicates
Diffstat (limited to 'c2x')
-rwxr-xr-xc2x14
1 files changed, 12 insertions, 2 deletions
diff --git a/c2x b/c2x
index 195c922..4ffcaf3 100755
--- a/c2x
+++ b/c2x
@@ -1,7 +1,17 @@
#!/bin/sh
-rsync ./"${1}" ./"${1}_xhtml"
-cd ./"${1}_xhtml" || exit
+# creates a $1_xhtml dir and that's your root
+rsync -r "./${1}/" "./${1}_xhtml/"
+cd "./${1}_xhtml" || exit
+printf "Converting gmi->html..."
for file in $(find ./* | grep ".gmi" | sed 's/.gmi//'); do
g2x < "./${file}.gmi" > "./${file}.html"
rm "./${file}.gmi"
done
+printf "done\n"
+# this down removes duplicate files
+# symlink them to the capsule root folder files
+printf "Fixing duplicates..."
+for file in $(find ./* -type f | grep -v ".html"); do
+ ln -sf ../../"${1}"/${file} "./${file}"
+done
+printf "done\n"