Allowing noter.sh to be called from outside its dir without breaking configs

This commit is contained in:
Siina Mashek 2024-02-17 16:36:06 +02:00
parent f8a2a1e449
commit f7ccdcbd35

View File

@ -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!"