move loglevel
This commit is contained in:
parent
d7e16afda2
commit
7f17eb9398
@ -566,9 +566,8 @@ def rename(
|
|||||||
"""Rename the app in the current directory."""
|
"""Rename the app in the current directory."""
|
||||||
from reflex.utils import prerequisites
|
from reflex.utils import prerequisites
|
||||||
|
|
||||||
console.set_log_level(loglevel)
|
|
||||||
prerequisites.validate_app_name(new_name)
|
prerequisites.validate_app_name(new_name)
|
||||||
prerequisites.rename_app(new_name)
|
prerequisites.rename_app(new_name, loglevel)
|
||||||
|
|
||||||
|
|
||||||
cli.add_typer(db_cli, name="db", help="Subcommands for managing the database schema.")
|
cli.add_typer(db_cli, name="db", help="Subcommands for managing the database schema.")
|
||||||
|
@ -504,6 +504,7 @@ def rename_path_up_tree(full_path: str | Path, old_name: str, new_name: str) ->
|
|||||||
new_base = base.replace(old_name, new_name)
|
new_base = base.replace(old_name, new_name)
|
||||||
new_path = directory / new_base
|
new_path = directory / new_base
|
||||||
current_path.rename(new_path)
|
current_path.rename(new_path)
|
||||||
|
console.debug(f"Renamed {current_path} -> {new_path}")
|
||||||
current_path = new_path
|
current_path = new_path
|
||||||
else:
|
else:
|
||||||
new_path = current_path
|
new_path = current_path
|
||||||
@ -514,15 +515,19 @@ def rename_path_up_tree(full_path: str | Path, old_name: str, new_name: str) ->
|
|||||||
return new_path
|
return new_path
|
||||||
|
|
||||||
|
|
||||||
def rename_app(new_app_name: str):
|
def rename_app(new_app_name: str, loglevel: constants.LogLevel):
|
||||||
"""Rename the app directory.
|
"""Rename the app directory.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
new_app_name: The new name for the app.
|
new_app_name: The new name for the app.
|
||||||
|
loglevel: The log level to use.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
Exit: If the command is not ran in the root dir or the app module cannot be imported.
|
Exit: If the command is not ran in the root dir or the app module cannot be imported.
|
||||||
"""
|
"""
|
||||||
|
# Set the log level.
|
||||||
|
console.set_log_level(loglevel)
|
||||||
|
|
||||||
if not constants.Config.FILE.exists():
|
if not constants.Config.FILE.exists():
|
||||||
console.error(
|
console.error(
|
||||||
"No rxconfig.py found. Make sure you are in the root directory of your app."
|
"No rxconfig.py found. Make sure you are in the root directory of your app."
|
||||||
|
Loading…
Reference in New Issue
Block a user