From e81d55d86f1b777e32b899994b6b0d43a6e68de8 Mon Sep 17 00:00:00 2001 From: eliot Date: Mon, 14 Aug 2023 10:21:51 -0700 Subject: [PATCH 1/2] zet link now hyperlinks zettels by URLs --- zet | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zet b/zet index 4b18bb2..d3efa72 100755 --- a/zet +++ b/zet @@ -14,7 +14,7 @@ PRIVATE=$ZETDIR_PRIVATE OPTION=$PUBLIC BASE_DIR=$ZET_SCRIPT_DIR TWEEPY_CONF="$BASE_DIR/util/tweepy.conf" -GIT_HOST="$GITHUB_URL/$(basename $PUBLIC)" +GIT_HOST="$GITHUB_URL/$(basename $OPTION)" AWS_CREDS="$HOME/.aws/credentials" r='\e[31m' # red @@ -171,7 +171,7 @@ x_isomin() { date -u +%Y%m%d%H%M ; } x_link() { readarray -t directories <<< "$(x_all)" if [[ " ${directories[*]} " =~ " $1 " ]]; then - link="[$1](../$1) - $(head -1 "$(x_dir)/$1/README.md" | sed 's/^# //')" + link="[$(head -1 "$(x_dir)/$1/README.md" | sed 's/^# //')]($GIT_HOST/tree/main/$1)" echo "$link" fi } From db063a4562c0a7f4f8f9680eee2e62ed5624f7d5 Mon Sep 17 00:00:00 2001 From: eliot Date: Mon, 14 Aug 2023 21:24:03 -0400 Subject: [PATCH 2/2] Added conditional to update zettel mappings only when tweepy.conf exists --- zet | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/zet b/zet index d3efa72..7b6859d 100755 --- a/zet +++ b/zet @@ -108,9 +108,12 @@ x_create() { sort -uo "$(x_dir)/REGISTRY.md"{,} echo "Committing: $line" $(x_push $line) - echo "Updating Zettel Mappings..." - x_zettel_mapping - x_zettel_repository "$datetime" + + if [[ -f "$TWEEPY_CONF" ]]; then + echo "Updating Zettel Mappings..." + x_zettel_mapping + x_zettel_repository "$datetime" + fi } ## sets the session directory to either the public or private zk @@ -132,9 +135,12 @@ x_edit() { test -n "$line" echo "Committing: $line" $(x_push $line) - echo "Updating Zettel Mappings..." - x_zettel_mapping - x_zettel_repository "$1" + + if [[ -f "$TWEEPY_CONF" ]]; then + echo "Updating Zettel Mappings..." + x_zettel_mapping + x_zettel_repository "$datetime" + fi fi }