run.sh: add check for config dir
This commit is contained in:
parent
b1f4f08b54
commit
895d2d3c0a
11
run.sh
11
run.sh
@ -3,6 +3,8 @@
|
|||||||
set -e
|
set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
configdir=$HOME/.config/tgschedpub
|
||||||
|
|
||||||
DIR="$(dirname "$(realpath "$0")")"
|
DIR="$(dirname "$(realpath "$0")")"
|
||||||
cd "$DIR"
|
cd "$DIR"
|
||||||
|
|
||||||
@ -13,4 +15,13 @@ if [ $install -eq 1 ]; then python3 -m venv .venv; fi
|
|||||||
./.venv/bin/activate
|
./.venv/bin/activate
|
||||||
if [ $install -eq 1 ]; then pip install -r requirements.txt; fi
|
if [ $install -eq 1 ]; then pip install -r requirements.txt; fi
|
||||||
|
|
||||||
|
[ -d "$configidr" ] || {
|
||||||
|
>&2 echo "error: config directory does not exists"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
[ -f "$configdir/config.yaml" ] || {
|
||||||
|
>&2 echo "error: $configdir/config.yaml does not exists"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
./tgschedpub.py "$@"
|
./tgschedpub.py "$@"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user