aboutsummaryrefslogtreecommitdiffstats
path: root/run.sh
blob: a31acb668f873111d14e0d7f7b09a5a427f3611b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env zsh
0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
0="${${(M)0:#/*}:-$PWD/$0}"

cd ${0:h}

setopt all_export
source .env
unsetopt all_export

script=$1
shift

if [[ -f $script ]]; then
  ./venv/bin/python3 $script $@
elif [[ -f scripts/$script ]]; then
  ./venv/bin/python3 scripts/$script $@
else
  print -u2 "Computer says no" && exit 1
fi

exit $?