diff options
author | Jacob Janzen <jacob.a.s.janzen@gmail.com> | 2024-10-01 20:05:13 -0500 |
---|---|---|
committer | Jacob Janzen <jacob.a.s.janzen@gmail.com> | 2024-10-01 20:05:13 -0500 |
commit | 0fcaa9bdf137de85fd405734c340fb9e08c3cf1f (patch) | |
tree | 0df23b503c25a04f53ca4fad354d8a3c446dd775 | |
parent | 477148d207308f190ece92868343fbe13bf6d7a6 (diff) |
maybe fix hidden files
-rw-r--r-- | .build.yml | 1 | ||||
-rwxr-xr-x | fix-dotfile-paths.sh | 4 | ||||
-rwxr-xr-x | post-publish.sh | 6 |
3 files changed, 11 insertions, 0 deletions
@@ -11,6 +11,7 @@ tasks: cd ~/.dotfiles ~/website/fix-dotfile-paths.sh emacs --batch -f package-initialize --script ~/website/publish.el + ~/website/post-publish.sh - package: | cd ~/public_html/ tar -cvz . > ../site.tar.gz diff --git a/fix-dotfile-paths.sh b/fix-dotfile-paths.sh index 450d1c2..ae5162e 100755 --- a/fix-dotfile-paths.sh +++ b/fix-dotfile-paths.sh @@ -16,6 +16,10 @@ create_ls_entry () { if [ "$files" != '' ]; then echo '* Files' >> index.org echo "$files" | sort | while read -r file; do + if echo $file | grep -q '^\.'; then + tmp=$(echo "$file" | sed 's/^\.//' | sed 's/$/.hidden/') + mv $file $tmp + fi if [ "$file" = ".wallpaper" ]; then echo "- [[https://wallhaven.cc/w/vgryy5][=.wallpaper=]]" >> index.org elif echo "$file" | grep -q "\.org$" && [ "$file" != "index.org" ]; then diff --git a/post-publish.sh b/post-publish.sh new file mode 100755 index 0000000..91e9e74 --- /dev/null +++ b/post-publish.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +find -L -- . -type f -name '*.hidden.html' | while read -r file; do + newfile=$(echo "$file" | sed 's/.hidden.html$/.html/' | sed 's/\/\([^\/]*\)$/\/.\1/') + mv "$file" "$newfile" +done |