fix: finalize one-click installer runtime
This commit is contained in:
+6
-2
@@ -32,6 +32,10 @@ run_logged() {
|
|||||||
fi
|
fi
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
run_visible_logged() {
|
||||||
|
"$@" 2>&1 | tee -a "$INSTALL_LOG"
|
||||||
|
return "${PIPESTATUS[0]}"
|
||||||
|
}
|
||||||
usage() { sed -n '1,20p' "$0"; }
|
usage() { sed -n '1,20p' "$0"; }
|
||||||
while (($#)); do
|
while (($#)); do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -227,11 +231,11 @@ fi
|
|||||||
progress '初始化数据库结构'
|
progress '初始化数据库结构'
|
||||||
if (( EXISTING_DB )); then
|
if (( EXISTING_DB )); then
|
||||||
export XYMEDIA_EXTERNAL_MIGRATION_CONFIRM=YES
|
export XYMEDIA_EXTERNAL_MIGRATION_CONFIRM=YES
|
||||||
if ! run_logged "${COMPOSE[@]}" --profile migration --project-directory "$INSTALL_DIR" --env-file "$INSTALL_DIR/.env" -f "$INSTALL_DIR/compose.yaml" run --rm --no-deps app-migrate migrate --config /app/config.yaml; then
|
if ! run_visible_logged "${COMPOSE[@]}" --profile migration --project-directory "$INSTALL_DIR" --env-file "$INSTALL_DIR/.env" -f "$INSTALL_DIR/compose.yaml" run --rm --no-deps app-migrate migrate --config /app/config.yaml; then
|
||||||
die '已有数据库迁移失败'
|
die '已有数据库迁移失败'
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if ! run_logged "${COMPOSE[@]}" --profile migration --project-directory "$INSTALL_DIR" --env-file "$INSTALL_DIR/.env" -f "$INSTALL_DIR/compose.yaml" run --rm --no-deps app-migrate migrate --new --config /app/config.yaml; then
|
if ! run_visible_logged "${COMPOSE[@]}" --profile migration --project-directory "$INSTALL_DIR" --env-file "$INSTALL_DIR/.env" -f "$INSTALL_DIR/compose.yaml" run --rm --no-deps app-migrate migrate --new --config /app/config.yaml; then
|
||||||
die '数据库初始化失败'
|
die '数据库初始化失败'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user