synchro des dépendances uniquement pour le type composer

This commit is contained in:
Jephté Clain 2019-06-20 15:10:42 +04:00
parent f508dae60f
commit ae70f66089
1 changed files with 29 additions and 15 deletions

26
dk
View File

@ -455,12 +455,26 @@ function build_update_apps() {
[ -n "$branch" ] || { branch="${var}_BRANCH"; branch="${!branch}"; } [ -n "$branch" ] || { branch="${var}_BRANCH"; branch="${!branch}"; }
[ -n "$branch" ] || branch="$DEFAULT_BRANCH" [ -n "$branch" ] || branch="$DEFAULT_BRANCH"
# calculer le type maintenant, on en a besoin pour le mode devel
type="${var}_TYPE"; type="${!type}"
dest="$dest/$app" dest="$dest/$app"
if [ -n "$BUILD_UPDATE_DEVEL" ]; then if [ -n "$BUILD_UPDATE_DEVEL" ]; then
# synchronisation en mode devel # synchronisation en mode devel
local -a rsync_opts; rsync_opts=(-a --delete --exclude .git/ --delete-excluded) local -a rsync_opts; rsync_opts=(-a --delete --exclude .git/ --delete-excluded)
estep "Synchro $devel_srcdir --> $dest" estep "Synchro $devel_srcdir --> $dest"
rsync "${rsync_opts[@]}" "$devel_srcdir/" "$dest" || { eend; return 1; } rsync "${rsync_opts[@]}" "$devel_srcdir/" "$dest" || { eend; return 1; }
if [ -z "$type" ]; then
# possible de détecter le type quand on a le projet
# en cas de maj ici, mettre à jour aussi le code ci-dessous
if [ -f "$dest/composer.json" ]; then type=composer
else type=inconnu
fi
fi
if [ "$type" == composer ]; then
# Synchronisation des dépendances
local -a depdirs; local depdir pname local -a depdirs; local depdir pname
setx -a depdirs=ls -d "$dest/vendor/"{lib,ur}/* 2>/dev/null setx -a depdirs=ls -d "$dest/vendor/"{lib,ur}/* 2>/dev/null
for depdir in "${depdirs[@]}"; do for depdir in "${depdirs[@]}"; do
@ -469,6 +483,7 @@ function build_update_apps() {
estep "Synchro $DEFAULT_DEVEL_SRCDIR/$pname --> $depdir" estep "Synchro $DEFAULT_DEVEL_SRCDIR/$pname --> $depdir"
rsync "${rsync_opts[@]}" --exclude /vendor/ "$DEFAULT_DEVEL_SRCDIR/$pname/" "$depdir" rsync "${rsync_opts[@]}" --exclude /vendor/ "$DEFAULT_DEVEL_SRCDIR/$pname/" "$depdir"
done done
fi
else else
if [ -d "$dest" -a -d "$dest/.git" ]; then if [ -d "$dest" -a -d "$dest/.git" ]; then
# mise à jour # mise à jour
@ -485,14 +500,13 @@ function build_update_apps() {
estep "Clonage $url:$branch --> $dest" estep "Clonage $url:$branch --> $dest"
git clone -o "$origin" -b "$branch" "$url" "$dest" || { eend; return 1; } git clone -o "$origin" -b "$branch" "$url" "$dest" || { eend; return 1; }
fi fi
fi
type="${var}_TYPE"; type="${!type}"
if [ -z "$type" ]; then if [ -z "$type" ]; then
if [ -f "$dest/composer.json" ]; then # possible de détecter le type quand on a le projet
type=composer # en cas de maj ici, mettre à jour aussi le code ci-dessus
else if [ -f "$dest/composer.json" ]; then type=composer
type=inconnu else type=inconnu
fi
fi fi
fi fi