Fix scratch bash script
This commit is contained in:
parent
89a191969f
commit
fee1f0601a
1 changed files with 5 additions and 3 deletions
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue