synchro des dépendances uniquement pour le type composer
This commit is contained in:
parent
f508dae60f
commit
ae70f66089
44
dk
44
dk
|
@ -455,20 +455,35 @@ function build_update_apps() {
|
|||
[ -n "$branch" ] || { branch="${var}_BRANCH"; branch="${!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"
|
||||
if [ -n "$BUILD_UPDATE_DEVEL" ]; then
|
||||
# synchronisation en mode devel
|
||||
local -a rsync_opts; rsync_opts=(-a --delete --exclude .git/ --delete-excluded)
|
||||
estep "Synchro $devel_srcdir --> $dest"
|
||||
rsync "${rsync_opts[@]}" "$devel_srcdir/" "$dest" || { eend; return 1; }
|
||||
local -a depdirs; local depdir pname
|
||||
setx -a depdirs=ls -d "$dest/vendor/"{lib,ur}/* 2>/dev/null
|
||||
for depdir in "${depdirs[@]}"; do
|
||||
[ -L "$depdir" ] && rm "$depdir"
|
||||
pname="${depdir#$dest/vendor/}"; pname="${pname/\//-}"
|
||||
estep "Synchro $DEFAULT_DEVEL_SRCDIR/$pname --> $depdir"
|
||||
rsync "${rsync_opts[@]}" --exclude /vendor/ "$DEFAULT_DEVEL_SRCDIR/$pname/" "$depdir"
|
||||
done
|
||||
|
||||
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
|
||||
setx -a depdirs=ls -d "$dest/vendor/"{lib,ur}/* 2>/dev/null
|
||||
for depdir in "${depdirs[@]}"; do
|
||||
[ -L "$depdir" ] && rm "$depdir"
|
||||
pname="${depdir#$dest/vendor/}"; pname="${pname/\//-}"
|
||||
estep "Synchro $DEFAULT_DEVEL_SRCDIR/$pname --> $depdir"
|
||||
rsync "${rsync_opts[@]}" --exclude /vendor/ "$DEFAULT_DEVEL_SRCDIR/$pname/" "$depdir"
|
||||
done
|
||||
fi
|
||||
else
|
||||
if [ -d "$dest" -a -d "$dest/.git" ]; then
|
||||
# mise à jour
|
||||
|
@ -485,14 +500,13 @@ function build_update_apps() {
|
|||
estep "Clonage $url:$branch --> $dest"
|
||||
git clone -o "$origin" -b "$branch" "$url" "$dest" || { eend; return 1; }
|
||||
fi
|
||||
fi
|
||||
|
||||
type="${var}_TYPE"; type="${!type}"
|
||||
if [ -z "$type" ]; then
|
||||
if [ -f "$dest/composer.json" ]; then
|
||||
type=composer
|
||||
else
|
||||
type=inconnu
|
||||
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-dessus
|
||||
if [ -f "$dest/composer.json" ]; then type=composer
|
||||
else type=inconnu
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue