Unverified Commit 47bfa879 authored by Marius van den Beek's avatar Marius van den Beek Committed by GitHub
Browse files

Merge pull request #20449 from mvdbeek/set_galaxy_config_file_env_var

[25.0] Set ``GALAXY_CONFIG_FILE`` env var if starting handler with `-c`
parents 01209e17 f0383dc8
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -225,6 +225,13 @@ def main(func=app_loop):
    args = arg_parser.parse_args()
    if args.ini_path and not args.config_file:
        args.config_file = args.ini_path
    if (config_file_env := os.environ.get("GALAXY_CONFIG_FILE")) and os.path.abspath(
        config_file_env
    ) != os.path.abspath(args.config_file):
        sys.exit(
            "Error: GALAXY_CONFIG_FILE environment variable is set to a different config file than the one specified on the command line."
        )
    os.environ["GALAXY_CONFIG_FILE"] = os.path.abspath(args.config_file)
    if args.log_file:
        os.environ["GALAXY_CONFIG_LOG_DESTINATION"] = os.path.abspath(args.log_file)
    if args.server_name: