mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-02-14 21:30:58 +01:00
Add taketmp function
This commit is contained in:
@@ -40,6 +40,10 @@ function mkcd takedir() {
|
|||||||
mkdir -p $@ && cd ${@:$#}
|
mkdir -p $@ && cd ${@:$#}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function taketmp() {
|
||||||
|
cd $(mktemp -d)
|
||||||
|
}
|
||||||
|
|
||||||
function takeurl() {
|
function takeurl() {
|
||||||
local data thedir
|
local data thedir
|
||||||
data="$(mktemp)"
|
data="$(mktemp)"
|
||||||
@@ -60,6 +64,8 @@ function take() {
|
|||||||
takeurl "$1"
|
takeurl "$1"
|
||||||
elif [[ $1 =~ ^([A-Za-z0-9]\+@|https?|git|ssh|ftps?|rsync).*\.git/?$ ]]; then
|
elif [[ $1 =~ ^([A-Za-z0-9]\+@|https?|git|ssh|ftps?|rsync).*\.git/?$ ]]; then
|
||||||
takegit "$1"
|
takegit "$1"
|
||||||
|
elif [[ "$1" == "" ]]; then
|
||||||
|
taketmp
|
||||||
else
|
else
|
||||||
takedir "$@"
|
takedir "$@"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user