mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
fix: add DATABASE_URI to environment variables in CLI command execution
This commit is contained in:
parent
3d7648dac0
commit
0f930e66aa
2 changed files with 4 additions and 1 deletions
|
|
@ -307,7 +307,7 @@ class CLI(ApiCaller):
|
|||
cmd.extend(args)
|
||||
|
||||
self.__logger.debug(f"Executing command {' '.join(cmd)}")
|
||||
proc = run(cmd, stdin=DEVNULL, stderr=STDOUT, check=False, env=self.__variables | environ | ({"LOG_LEVEL": "DEBUG"} if debug else {})) # type: ignore
|
||||
proc = run(cmd, stdin=DEVNULL, stderr=STDOUT, check=False, env=self.__variables | environ | ({"LOG_LEVEL": "DEBUG"} if debug else {}) | ({"DATABASE_URI": self.__db.database_uri} if self.__db else {})) # type: ignore
|
||||
|
||||
if proc.returncode != 0:
|
||||
return False, f"Command {command} failed"
|
||||
|
|
|
|||
|
|
@ -60,6 +60,9 @@ if __name__ == "__main__":
|
|||
# Parse args
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.debug:
|
||||
logger.setLevel("DEBUG")
|
||||
|
||||
# Instantiate CLI
|
||||
cli = CLI()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue