améliorer le calcul du répertoire destination avec pclone/pcrone
This commit is contained in:
parent
6411e639d9
commit
f460399dd5
13
uproject
13
uproject
|
@ -270,9 +270,13 @@ elif array_contains GITANNEX_CMDS "$CMD"; then
|
|||
elif [ "$CMD" == clone ]; then
|
||||
repourl="${1%.git}"
|
||||
[ -n "$repourl" ] || die "Vous devez spécifier l'url du dépôt git"
|
||||
splitfsep "$repourl" : userhost path
|
||||
|
||||
destdir="$2"
|
||||
[ -n "$destdir" ] || setx destdir=basename -- "$repourl"
|
||||
if [ -z "$destdir" ]; then
|
||||
setx destdir=basename -- "$path"
|
||||
destdir="${destdir%.git}"
|
||||
fi
|
||||
[ -d "$destdir" ] && die "$(ppath "$destdir"): répertoire existant"
|
||||
|
||||
use_ssh_wrapper
|
||||
|
@ -282,12 +286,15 @@ elif [ "$CMD" == clone ]; then
|
|||
elif [ "$CMD" == crone ]; then
|
||||
repourl="${1%.git}"
|
||||
[ -n "$repourl" ] || die "Vous devez spécifier l'url du dépôt git"
|
||||
splitfsep "$repourl" : userhost path
|
||||
|
||||
destdir="$2"
|
||||
[ -n "$destdir" ] || setx destdir=basename -- "$repourl"
|
||||
if [ -z "$destdir" ]; then
|
||||
setx destdir=basename -- "$path"
|
||||
destdir="${destdir%.git}"
|
||||
fi
|
||||
[ -d "$destdir" ] && die "$(ppath "$destdir"): répertoire existant"
|
||||
|
||||
splitfsep "$repourl" : userhost path
|
||||
splituserhost "$userhost" user host
|
||||
[ -n "$user" ] || user=git
|
||||
[ -n "$host" ] || die "Vous devez spécifier l'hôte"
|
||||
|
|
Loading…
Reference in New Issue