Fix scratch bash script

This commit is contained in:
Talia 2019-09-18 14:31:20 +02:00
parent 89a191969f
commit fee1f0601a

View file

@ -1,9 +1,11 @@
#!/bin/bash
export scratch=$(mktemp -p /dev/shm -d -t tmp.XXXXXXXXXX)
function finish {
echo "Deleting $scratch..."
rm -rf "$scratch"
}
trap finish EXIT
trap finish TERM
exec bash --init-file <(echo "source ~/.bashrc; pushd $scratch > /dev/null")
trap finish SIGTERM
bash --init-file <(echo "source ~/.bashrc; pushd $scratch > /dev/null")