From 116945654481a03fcb946e1835f457466b8822dc Mon Sep 17 00:00:00 2001
From: Jacob Janzen <jjanzenn@proton.me>
Date: Thu, 8 Aug 2024 20:15:56 -0500
Subject: fix paths

---
 fix-dotfile-paths.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'fix-dotfile-paths.sh')

diff --git a/fix-dotfile-paths.sh b/fix-dotfile-paths.sh
index 255e1b1..dd8085b 100755
--- a/fix-dotfile-paths.sh
+++ b/fix-dotfile-paths.sh
@@ -3,9 +3,9 @@
 create_ls_entry () {
     echo "#+title: =~/$1=" > index.org
     echo "* Directories" >> index.org
-    find -- . -maxdepth 1 -type d | sed 's/^\.\///' | while read -r dir; do
+    find -- . -maxdepth 1 -type d | sed '/^\.$/d' | sed 's/^\.\///' | while read -r dir; do
         if [ "${dir}" != "*" ]; then
-            echo "- [[https://jjanzen.ca/dotfiles/$1/${dir}][${dir}]]" >> index.org
+            echo "- [[https://jjanzen.ca/dotfiles/$1${dir}][${dir}]]" >> index.org
         fi
     done
     echo "* Files" >> index.org
@@ -24,7 +24,7 @@ create_ls_entry () {
                 new_file=$file
             fi
             html=$(echo "${file}" | sed 's/\.org\$/\.html/')
-            echo "- [[https://jjanzen.ca/dotfiles/$1/${html}][${new_file}]]" >> index.org
+            echo "- [[https://jjanzen.ca/dotfiles/$1${html}][${new_file}]]" >> index.org
         fi
     done
 }
@@ -40,7 +40,7 @@ find -- . -type d | sed '/^\.$/d' | sed '/^\.\/\.git\//d' | sed '/^\.\/.git/d' |
 
     dir=$(echo "${dir}" | sed 's/^\.\///')
 
-    create_ls_entry "${dir}"
+    create_ls_entry "${dir}/"
 
     cd "${START}" || exit
 done
-- 
cgit v1.2.3