show logs for debug mode

This commit is contained in:
Elijah 2023-11-02 15:48:43 +00:00
parent 3e535aa42a
commit 72d94cad22

View File

@ -522,12 +522,15 @@ def install_frontend_packages(packages: set[str]):
prefer_offline = ( prefer_offline = (
["--prefer-offline"] if config.npm_prefer_offline and uses_npm else [] ["--prefer-offline"] if config.npm_prefer_offline and uses_npm else []
) )
# show logs for debug mode.
show_logs = config.loglevel >= constants.LogLevel.DEBUG
# Install the base packages. # Install the base packages.
process = processes.new_process( process = processes.new_process(
[package_manager, "install", "--loglevel", "silly", *prefer_offline], [package_manager, "install", "--loglevel", "silly", *prefer_offline],
cwd=constants.Dirs.WEB, cwd=constants.Dirs.WEB,
shell=constants.IS_WINDOWS, shell=constants.IS_WINDOWS,
show_logs=show_logs
) )
processes.show_status("Installing base frontend packages", process) processes.show_status("Installing base frontend packages", process)
@ -544,6 +547,7 @@ def install_frontend_packages(packages: set[str]):
], ],
cwd=constants.Dirs.WEB, cwd=constants.Dirs.WEB,
shell=constants.IS_WINDOWS, shell=constants.IS_WINDOWS,
show_logs=show_logs
) )
processes.show_status("Installing tailwind", process) processes.show_status("Installing tailwind", process)
@ -552,6 +556,7 @@ def install_frontend_packages(packages: set[str]):
[package_manager, "add", *packages, *prefer_offline], [package_manager, "add", *packages, *prefer_offline],
cwd=constants.Dirs.WEB, cwd=constants.Dirs.WEB,
shell=constants.IS_WINDOWS, shell=constants.IS_WINDOWS,
show_logs=show_logs
) )
processes.show_status( processes.show_status(
"Installing frontend packages from config and components", process "Installing frontend packages from config and components", process
@ -698,8 +703,8 @@ def check_schema_up_to_date():
with model.Model.get_db_engine().connect() as connection: with model.Model.get_db_engine().connect() as connection:
try: try:
if model.Model.alembic_autogenerate( if model.Model.alembic_autogenerate(
connection=connection, connection=connection,
write_migration_scripts=False, write_migration_scripts=False,
): ):
console.error( console.error(
"Detected database schema changes. Run [bold]reflex db makemigrations[/bold] " "Detected database schema changes. Run [bold]reflex db makemigrations[/bold] "