allow using as specific starter script

This commit is contained in:
2023-11-30 15:09:31 +01:00
parent 3c6007a46a
commit 72a89ebf06

20
run
View File

@ -1,5 +1,25 @@
#!/bin/bash
# The following block allows to use the `run` script like this
# ```
# ln -s run a_script.sh
# ./a_script.sh
# ```
# which then runs `./run a_script.py`
fn=$(basename $0)
if [ "$fn" != "run" ]; then
dn=$(dirname "$0")
sn=$(basename "$0" .sh)
dn="${dn}/run"
sn="${sn}.py"
echo "Running: $dn $sn"
$dn $sn
exit
fi
###
function help() {
echo "Load conda env and run a script"
echo