This commit is contained in:
Jephté Clain 2019-05-30 22:43:23 +04:00
parent a825f3b931
commit 99d5069b55
1 changed files with 17 additions and 11 deletions

28
dk
View File

@ -253,7 +253,10 @@ function update_apps_func_sqlmig() {
[ -n "$srcdir" ] || srcdir="$dest"
[ "${srcdir%/config/sqlmig}" != "$srcdir" ] || srcdir="$srcdir/config/sqlmig"
[ -d "$srcdir" ] || return 0
if [ ! -d "$srcdir" ]; then
eerror "$srcdir: répertoire introuvable"
return 1
fi
local -a sqlmigs; local sqlmig name
array_lsall sqlmigs "$srcdir"
@ -293,25 +296,28 @@ function build_update_apps() {
esac
etitle "Mise à jour des dépendances"
local app type url dest branch after_update after_updates
local app var type url dest branch after_update after_updates
for app in "${APPS[@]}"; do
etitle "$app"
url="${app}_URL"; url="${!url}"
var="${app//-/_}"
url="${var}_URL"; url="${!url}"
[ -n "$url" ] || {
ewarn "$app: vous devez définir l'url"
eend; return 1
}
dest="${app}_DEST"; dest="${!dest}"
dest="${var}_DEST"; dest="${!dest}"
[ -n "$dest" ] || dest="$app/b"
mkdir -p "$dest" || { eend; return 1; }
origin="${app}_${PROFILE}_ORIGIN"; origin="${!origin}"
[ -n "$origin" ] || { origin="${app}_ORIGIN"; origin="${!origin}"; }
origin="${var}_${PROFILE}_ORIGIN"; origin="${!origin}"
[ -n "$origin" ] || { origin="${var}_ORIGIN"; origin="${!origin}"; }
[ -n "$origin" ] || origin="$DEFAULT_ORIGIN"
branch="${app}_${PROFILE}_BRANCH"; branch="${!branch}"
[ -n "$branch" ] || { branch="${app}_BRANCH"; branch="${!branch}"; }
branch="${var}_${PROFILE}_BRANCH"; branch="${!branch}"
[ -n "$branch" ] || { branch="${var}_BRANCH"; branch="${!branch}"; }
[ -n "$branch" ] || branch="$DEFAULT_BRANCH"
dest="$dest/$app"
@ -329,7 +335,7 @@ function build_update_apps() {
cd "$cwd"
fi
type="${app}_TYPE"; type="${!type}"
type="${var}_TYPE"; type="${!type}"
if [ -z "$type" ]; then
if [ -f "$dest/composer.json" ]; then
type=composer
@ -338,9 +344,9 @@ function build_update_apps() {
fi
fi
after_updates="${app}_AFTER_UPDATE"
after_updates="${var}_AFTER_UPDATE"
if is_defined "$after_updates"; then
after_updates="$after_updates[@]"; after_updates="${!after_updates}"
after_updates="$after_updates[@]"; after_updates=("${!after_updates}")
elif [ "$type" == composer ]; then
after_updates=(sqlmig)
else