diff options
author | David Wührer <def@gmx.at> | 2025-07-09 15:19:53 +0200 |
---|---|---|
committer | David Wührer <def@gmx.at> | 2025-07-09 15:19:53 +0200 |
commit | 5f2f801c993e6eb9ebc667d71adc443e4befd80f (patch) | |
tree | b68e255b5e73a95d4537b7a07187976a81ea11cc | |
parent | 2366d7fe1cad62ac31a7e643c8391d12169cb355 (diff) |
extend clone
-rwxr-xr-x | bin/clone | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -9,6 +9,9 @@ do https://*|git://*) dir=${url#*//} dir=${dir%/*} + ;; ssh://*) + dir=${url#ssh://} + dir=${dir#*@} ;; git@*) dir=${url#git@} dir=${dir/://} @@ -17,6 +20,9 @@ do args+=("$url") continue esac + [[ $dir ]] || { echo >&2 no directory; exit 1;} + h=${dir%%:*} + [[ $h != $dir ]] && dir=$h/${dir#*/} mkdir -vp ~/src/"$dir" cd ~/src/"$dir" git clone --verbose --progress "${args[@]}" "$url" |