Add taketmp function

This commit is contained in:
Eugene Kalinin 2021-08-20 11:04:08 +03:00 committed by GitHub
parent cbb534267a
commit 867d2e0196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,6 +40,10 @@ function mkcd takedir() {
mkdir -p $@ && cd ${@:$#}
}
function taketmp() {
cd $(mktemp -d)
}
function takeurl() {
local data thedir
data="$(mktemp)"
@ -60,6 +64,8 @@ function take() {
takeurl "$1"
elif [[ $1 =~ ^([A-Za-z0-9]\+@|https?|git|ssh|ftps?|rsync).*\.git/?$ ]]; then
takegit "$1"
elif [[ "$1" == "" ]]; then
taketmp
else
takedir "$@"
fi