allow using as specific starter script
This commit is contained in:
20
run
20
run
@ -1,5 +1,25 @@
|
|||||||
#!/bin/bash
|
#!/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() {
|
function help() {
|
||||||
echo "Load conda env and run a script"
|
echo "Load conda env and run a script"
|
||||||
echo
|
echo
|
||||||
|
Reference in New Issue
Block a user