Add init command and first-run guidance flow
This commit is contained in:
parent
e262b26db7
commit
706d9e2da7
2 changed files with 38 additions and 0 deletions
|
|
@ -470,6 +470,7 @@ def _init_command(args: argparse.Namespace) -> int:
|
|||
def _run_command(args: argparse.Namespace) -> int:
|
||||
global _LOCK_HANDLE
|
||||
config_path = Path(args.config) if args.config else DEFAULT_CONFIG_PATH
|
||||
config_existed_before_start = config_path.exists()
|
||||
|
||||
try:
|
||||
cfg = load(str(config_path))
|
||||
|
|
@ -489,6 +490,9 @@ def _run_command(args: argparse.Namespace) -> int:
|
|||
str(config_path),
|
||||
json.dumps(redacted_dict(cfg), indent=2),
|
||||
)
|
||||
if not config_existed_before_start and config_path.exists():
|
||||
logging.info("created default config at %s", config_path)
|
||||
logging.info("next step: run `aman doctor --config %s`", config_path)
|
||||
logging.info(
|
||||
"runtime: pid=%s session=%s display=%s wayland_display=%s verbose=%s dry_run=%s",
|
||||
os.getpid(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue