mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-09-08 02:08:01 +08:00
fix(migrations): parse the --config flag the usage line documents (#18817)
This commit is contained in:
@@ -15,7 +15,30 @@
|
||||
set -e
|
||||
|
||||
PY="${PY:-python3}"
|
||||
CONFIG="${1:-conf/service_conf.yaml}"
|
||||
CONFIG="conf/service_conf.yaml"
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--config)
|
||||
# Require a real file. mysql_migration.py:90 turns any config-load
|
||||
# failure into a warning and falls back to host=localhost user=root
|
||||
# database=rag_flow, and this script also passes --execute, so an
|
||||
# empty, whitespace, flag-shaped or missing path would silently
|
||||
# migrate the default database instead of failing.
|
||||
if [ $# -lt 2 ] || [ -z "${2//[[:space:]]/}" ] || [ ! -f "$2" ] || [ "${2#-}" != "$2" ]; then
|
||||
echo "Error: --config requires the path of an existing file" >&2
|
||||
exit 1
|
||||
fi
|
||||
CONFIG="$2"
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
echo "Error: unknown argument: $1" >&2
|
||||
echo "Usage: PY=python3 tools/scripts/run_migrations.sh [--config CONFIG_PATH]" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "Running model provider table migrations..."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user