Handle .do files that start with "#!/" to specify an explicit interpreter.
Now you can have your .do files interpreted by whatever interpreter you want.
This commit is contained in:
parent
f24d4f142b
commit
f641e52e3b
7 changed files with 38 additions and 11 deletions
|
|
@ -57,7 +57,13 @@ _run_dofile()
|
|||
export DO_DEPTH="$DO_DEPTH "
|
||||
export REDO_TARGET=$PWD/$TARGET
|
||||
set -e
|
||||
. "$PWD/$DOFILE" >"$TARGET.tmp2"
|
||||
read line1 <"$PWD/$DOFILE"
|
||||
cmd=${line1#"#!/"}
|
||||
if [ "$cmd" != "$line1" ]; then
|
||||
/$cmd "$PWD/$DOFILE" "$@" >"$TARGET.tmp2"
|
||||
else
|
||||
. "$PWD/$DOFILE" >"$TARGET.tmp2"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue