diff options
author | nytpu <alex@nytpu.com> | 2021-04-13 13:21:03 -0600 |
---|---|---|
committer | nytpu <alex@nytpu.com> | 2021-04-13 13:21:03 -0600 |
commit | 1f3a9a87b6ced92266f9a940df783a5383c797b9 (patch) | |
tree | 3eafbcc4d67a0398d5993c86c477f54996f453b5 | |
parent | Fix readme (diff) | |
download | gemlog.sh-1f3a9a87b6ced92266f9a940df783a5383c797b9.tar.bz2 gemlog.sh-1f3a9a87b6ced92266f9a940df783a5383c797b9.zip |
fix issue with ls and complicated regexes
-rwxr-xr-x | gemlog.sh | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -71,7 +71,7 @@ EOF printf "</updated>\n <summary>You need a gemini client to view this post. If you have one installed, here is the link to the post: $global_url${i#'./'}</summary>\n </entry>\n" n=$(( n + 1 )) - done < <(ls -r [[:digit:]]*.gmi) + done < <(find * -type f -name "[[:digit:]]*.gmi" | sort -r) printf "</feed>\n" } 3>&1 >"$atomfile" @@ -112,7 +112,7 @@ build_entries() { fi printf "=> $post $pubdate — $title\n" - done < <(ls -r [[:digit:]]*.gmi) + done < <(find * -type f -name "[[:digit:]]*.gmi" | sort -r) # footer of the page (below the list of posts) perl -pe 's/\$(\w+)/$ENV{$1}/g' "$HOME/.config/gemlog.sh/footer.gmi" @@ -123,7 +123,7 @@ build_entries() { } toot() { - filename=$(ls -r ./[[:digit:]]*.gmi | head -n 1 | xargs basename) + filename=$(find * -type f -name "[[:digit:]]*.gmi" | sort -r | head -n 1 | xargs basename) title=$(get_post_title "$filename") read -r -p "do you want to toot the newest post? [y/N] " response if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]] |