Skip to content
Snippets Groups Projects
Commit 6d33253c authored by Jens Nolte's avatar Jens Nolte
Browse files

Add `tmp` shell function to enter shell in temporary directory

parent fa9474eb
No related branches found
No related tags found
No related merge requests found
......@@ -332,5 +332,15 @@ in
builtin cd "$@"
fi
}
tmp () (
readonly tmpdir=$(mktemp -d ''${1:-})
[[ -z $tmpdir ]] && exit 1
TRAPEXIT() {
rm -rf $tmpdir
}
cd $tmpdir
zsh -is
)
'';
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment