From f7ccdcbd351b3dae5631f0b87552837312bfed11 Mon Sep 17 00:00:00 2001 From: Siina Mashek Date: Sat, 17 Feb 2024 16:36:06 +0200 Subject: [PATCH] Allowing noter.sh to be called from outside its dir without breaking configs --- noter.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/noter.sh b/noter.sh index c3c0fa5..81db64d 100755 --- a/noter.sh +++ b/noter.sh @@ -1,8 +1,6 @@ #!/bin/bash # noter 1.3.0 - "nice configs" - @k@layer8.space - mit -source ./config.sh - # Overwrite publish_dir if passed as argument [[ ! -z "$1" ]] && publish_dir="$1" @@ -15,6 +13,9 @@ nlog() { echo -e "${ORANGE}[noter] ${calling_function} | ${1} ${NO_COLOR}" } +noter_dir="$(dirname -- $(readlink -f "${BASH_SOURCE}"))" +nlog "Sourcing $noter_dir/config.sh" +source $noter_dir/config.sh if [ ! -d "notes" ]; then nlog "Error: 'notes' folder not found!"