Allowing noter.sh to be called from outside its dir without breaking configs
This commit is contained in:
parent
f8a2a1e449
commit
f7ccdcbd35
1 changed files with 3 additions and 2 deletions
5
noter.sh
5
noter.sh
|
@ -1,8 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# noter 1.3.0 - "nice configs" - @k@layer8.space - mit
|
# noter 1.3.0 - "nice configs" - @k@layer8.space - mit
|
||||||
|
|
||||||
source ./config.sh
|
|
||||||
|
|
||||||
# Overwrite publish_dir if passed as argument
|
# Overwrite publish_dir if passed as argument
|
||||||
[[ ! -z "$1" ]] && publish_dir="$1"
|
[[ ! -z "$1" ]] && publish_dir="$1"
|
||||||
|
|
||||||
|
@ -15,6 +13,9 @@ nlog() {
|
||||||
echo -e "${ORANGE}[noter] ${calling_function} | ${1} ${NO_COLOR}"
|
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
|
if [ ! -d "notes" ]; then
|
||||||
nlog "Error: 'notes' folder not found!"
|
nlog "Error: 'notes' folder not found!"
|
||||||
|
|
Reference in a new issue