From d9ce5332998ac540c8b2fda4c82a071f81eec834 Mon Sep 17 00:00:00 2001 From: Jacob Janzen Date: Thu, 8 Aug 2024 20:04:28 -0500 Subject: more bug fixes --- fix-dotfile-paths.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'fix-dotfile-paths.sh') diff --git a/fix-dotfile-paths.sh b/fix-dotfile-paths.sh index c6d6827..aa0197d 100755 --- a/fix-dotfile-paths.sh +++ b/fix-dotfile-paths.sh @@ -18,12 +18,13 @@ create_ls_entry () { continue fi - if echo "${file}" | grep -q "\.org\$"; then + if echo "${file}" | grep -q "\.org$"; then new_file=$(basename "$(grep '#+begin_src' "${file}" | head -1 | cut -d ' ' -f 4)") else new_file=$file fi - echo "- [[https://jjanzen.ca/dotfiles/$1/${file}][${new_file}]]" >> index.org + html=$(echo "${file}" | sed 's/\.org\$/\.html/') + echo "- [[https://jjanzen.ca/dotfiles/$1/${html}][${new_file}]]" >> index.org fi done } @@ -32,10 +33,10 @@ cd ~/.dotfiles || exit START=$(pwd) # iterate over all files except the .git/ directory and . -find -- . -type d | sed '/^\.\$/d' | sed '/^\.\/\.git\//d' | sed '/^\.\/.git/d' | while read -r dir; do +find -- . -type d | sed '/^\.$/d' | sed '/^\.\/\.git\//d' | sed '/^\.\/.git/d' | while read -r dir; do cd "${dir}" || continue - line=$(echo "${line}" | sed 's/^\.\///') + dir=$(echo "${dir}" | sed 's/^\.\///') create_ls_entry "${dir}" -- cgit v1.2.3