astro

a POSIX shell compatible gemini client (mirror of https://github.com/blmayer/astro)
git clone https://git.clttr.info/astro.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit 77791635d48e1966bbaae8b06e3a255285f2fd0b
parent 53668a01925a2ec2a62b5b661ef180dde7ecb384
Author: Brian Mayer <bleemayer@gmail.com>
Date:   Tue, 17 Jan 2023 23:19:55 -0300

Merge pull request #25 from rnwgnr/patch1

fix handling of custom cache dir
Diffstat:
Mastro | 17+++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/astro b/astro @@ -45,6 +45,10 @@ version() { echo "Written by Brian Lee Mayer." } +debug() { + [ "$debug" ] && echo "DEBUG: $*" >&2 && sleep 2 +} + # Save terminal tput smcup @@ -59,9 +63,6 @@ mkdir -p "$certdir" [ -z "$cachehome" ] && cachehome=${XDG_CACHE_HOME:-$HOME/.cache} cachedir="$cachehome/astro" -mkdir -p "$cachedir" -histfile="$cachedir/history" -linksfile="$cachedir/links" # This is the final binary form, to save space, it corresponds to: # o (49): go to a URL @@ -78,7 +79,7 @@ if [ ! -s "$configfile" ] then # Default values cat << EOF > "$configfile" -cachehome="$cachehome" +cachedir="$cachehome" margin=8 homepage="gemini.circumlunar.space/" sty_header1='35;7;1' @@ -94,6 +95,10 @@ fi . "$configfile" +mkdir -p "$cachedir" +histfile="$cachedir/history" +linksfile="$cachedir/links" + # Restore terminal trap 'tput rmcup && rm -f $histfile $linksfile > /dev/null 2>&1; exit' EXIT INT HUP @@ -107,10 +112,6 @@ sty_linkt="\\033[${sty_linkt}m" sty_listb="\\033[${sty_listb}m" sty_listt="\\033[${sty_listt}m" -debug() { - [ "$debug" ] && echo "DEBUG: $*" >&2 && sleep 2 -} - getprevious() { sed -i '$d' "$histfile" prev="$(tail -n 1 "$histfile")"