aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornytpu <alex@nytpu.com>2021-04-13 13:21:03 -0600
committernytpu <alex@nytpu.com>2021-04-13 13:21:03 -0600
commit1f3a9a87b6ced92266f9a940df783a5383c797b9 (patch)
tree3eafbcc4d67a0398d5993c86c477f54996f453b5
parentFix readme (diff)
downloadgemlog.sh-1f3a9a87b6ced92266f9a940df783a5383c797b9.tar.bz2
gemlog.sh-1f3a9a87b6ced92266f9a940df783a5383c797b9.zip
fix issue with ls and complicated regexes
-rwxr-xr-xgemlog.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/gemlog.sh b/gemlog.sh
index a59e7fe..63c7eaf 100755
--- a/gemlog.sh
+++ b/gemlog.sh
@@ -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])$ ]]