mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
Add taketmp function
This commit is contained in:
parent
cbb534267a
commit
867d2e0196
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue