From 72c3512072cedc4609507944e150f0995af49fb3 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Fri, 10 May 2019 16:29:30 +0400 Subject: [PATCH] =?UTF-8?q?dk:=20bug=20dans=20la=20d=C3=A9tection=20du=20t?= =?UTF-8?q?ype=20de=20projet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dk | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/dk b/dk index 16a400a..b8b938d 100755 --- a/dk +++ b/dk @@ -314,6 +314,21 @@ function build_update_apps() { [ -n "$branch" ] || { branch="${app}_BRANCH"; branch="${!branch}"; } [ -n "$branch" ] || branch="$DEFAULT_BRANCH" + dest="$dest/$app" + if [ ! -d "$dest" ]; then + # clonage initial + estep "Clonage $url:$branch --> $dest" + git clone -o "$origin" -b "$branch" "$url" "$dest" || { eend; return 1; } + else + # mise à jour + estep "Maj dépôt $url:$branch --> $dest" + setx cwd=pwd + cd "$dest" + git fetch --all -p -f || { eend; return 1; } + git reset --hard "$origin/$branch" || { eend; return 1; } + cd "$cwd" + fi + type="${app}_TYPE"; type="${!type}" if [ -z "$type" ]; then if [ -f "$dest/composer.json" ]; then @@ -332,21 +347,6 @@ function build_update_apps() { after_updates=() fi - dest="$dest/$app" - if [ ! -d "$dest" ]; then - # clonage initial - estep "Clonage $url:$branch --> $dest" - git clone -o "$origin" -b "$branch" "$url" "$dest" || { eend; return 1; } - else - # mise à jour - estep "Maj dépôt $url:$branch --> $dest" - setx cwd=pwd - cd "$dest" - git fetch --all -p -f || { eend; return 1; } - git reset --hard "$origin/$branch" || { eend; return 1; } - cd "$cwd" - fi - estep "Type de dépôt: $type" if [ "$type" == composer ]; then composer=/usr/bin/composer