Update scratch to allow running scripts

When passing any arguments to scratch, they will be executed as a
command in the temporary directory
This commit is contained in:
Talia 2019-09-18 14:47:50 +02:00
parent fee1f0601a
commit 4fef56cdb8
1 changed files with 7 additions and 1 deletions

View File

@ -8,4 +8,10 @@ function finish {
trap finish EXIT
trap finish SIGTERM
bash --init-file <(echo "source ~/.bashrc; pushd $scratch > /dev/null")
if [ -z $1 ]
then
bash --init-file <(echo "source ~/.bashrc; pushd $scratch > /dev/null")
else
cd $scratch
"$@"
fi