Adding noter_dir to be able to use noter to generate multiple sites

This commit is contained in:
Siina Mashek 2024-02-17 17:30:14 +02:00
parent 7f342188d5
commit 5ec3c6130c
2 changed files with 6 additions and 2 deletions

View File

@ -11,7 +11,8 @@ nlog() {
}
nlog "sourcing config.sh"
source ./config.sh
noter_dir=$(dirname "$0")
source $noter_dir/config.sh
# Override publish dir if passed as cli arg
[[ ! -z "$1" ]] && nlog "overriding publish_dir to $1" && publish_dir="$1"

View File

@ -16,6 +16,9 @@ nlog "opening note notes/$current_time.txt"
filename="notes/${current_date}.txt"
$EDITOR "$filename"
# Get writer's location in case executed elsewhere
noter_dir=$(dirname "$0")
# Override publish dir if passed as cli arg
[[ ! -z "$1" ]] && publish_dir="$1"
./noter.sh "${publish_dir}"
"$noter_dir/noter.sh" "${publish_dir}"