Skip to content

Commit

Permalink
chore: improve ok messages on start
Browse files Browse the repository at this point in the history
  • Loading branch information
dantetemplar committed Nov 20, 2024
1 parent 3916a4b commit 4ac1dd7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/api/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def ensure_settings_file():
return

if SETTINGS_FILE.exists():
print("✅ `settings.yaml` already exists. Skipping copying.")
print("✅ `settings.yaml` exists.")
return

shutil.copy(SETTINGS_TEMPLATE, SETTINGS_FILE)
Expand All @@ -42,7 +42,7 @@ def check_and_prompt_api_jwt_token():
return

try:
with open(SETTINGS_FILE, "r") as f:
with open(SETTINGS_FILE) as f:
settings = yaml.safe_load(f) or {}
except Exception as e:
print(f"❌ Error reading `settings.yaml`: {e}")
Expand All @@ -58,11 +58,11 @@ def check_and_prompt_api_jwt_token():
webbrowser.open(ACCOUNTS_TOKEN_URL)
print(" 🔑 Please paste the generated token below:")

token = input(" Enter the token here (or press Enter to skip): ").strip()
token = input(" Enter the token here (or press Enter to skip):\n>").strip()

if token:
try:
with open(SETTINGS_FILE, "r") as f:
with open(SETTINGS_FILE) as f:
as_text = f.read()
as_text = as_text.replace("api_jwt_token: null", f"api_jwt_token: {token}")
as_text = as_text.replace("api_jwt_token: ...", f"api_jwt_token: {token}")
Expand All @@ -75,7 +75,7 @@ def check_and_prompt_api_jwt_token():
print(" ⚠️ Token was not provided. Please manually update `settings.yaml` later.")
print(f" ➡️ Refer to the URL: {ACCOUNTS_TOKEN_URL}")
else:
print("✅ `accounts.api_jwt_token` is already set.")
print("✅ `accounts.api_jwt_token` is specified.")


def ensure_pre_commit_hooks():
Expand All @@ -92,7 +92,7 @@ def is_pre_commit_installed():
return

if is_pre_commit_installed():
print("✅ Pre-commit hooks are already installed. Skipping pre-commit setup.")
print("✅ Pre-commit hooks are installed.")
return

try:
Expand Down

0 comments on commit 4ac1dd7

Please sign in to comment.