From 4fef56cdb8f96225771a3af842d48a05ba9cd4e8 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Wed, 18 Sep 2019 14:47:50 +0200 Subject: [PATCH] Update scratch to allow running scripts When passing any arguments to scratch, they will be executed as a command in the temporary directory --- bin/scratch | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/scratch b/bin/scratch index e61ee97..95a4362 100755 --- a/bin/scratch +++ b/bin/scratch @@ -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