Skip to content

Commit f0383dc

Browse files
committed
Set GALAXY_CONFIG_FILE env var if staring handler with -c
1 parent 01209e1 commit f0383dc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/galaxy_main.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,13 @@ def main(func=app_loop):
225225
args = arg_parser.parse_args()
226226
if args.ini_path and not args.config_file:
227227
args.config_file = args.ini_path
228+
if (config_file_env := os.environ.get("GALAXY_CONFIG_FILE")) and os.path.abspath(
229+
config_file_env
230+
) != os.path.abspath(args.config_file):
231+
sys.exit(
232+
"Error: GALAXY_CONFIG_FILE environment variable is set to a different config file than the one specified on the command line."
233+
)
234+
os.environ["GALAXY_CONFIG_FILE"] = os.path.abspath(args.config_file)
228235
if args.log_file:
229236
os.environ["GALAXY_CONFIG_LOG_DESTINATION"] = os.path.abspath(args.log_file)
230237
if args.server_name:

0 commit comments

Comments
 (0)