Skip to content

Commit c8b1656

Browse files
Copilotwax911
andcommitted
fix(cli): address PR review comments - cross-platform time, formatting, unused var (#374)
* Initial plan * fix(cli): address PR review comments - cross-platform time, formatting, unused var Co-authored-by: wax911 <7859175+wax911@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wax911 <7859175+wax911@users.noreply.github.com>
1 parent 01ef276 commit c8b1656

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tools/stackctl_cli.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import shutil
3131
import subprocess
3232
import sys
33+
import time
3334
from dataclasses import dataclass
3435
from pathlib import Path
3536
from typing import Dict, List, Optional, Tuple
@@ -255,7 +256,7 @@ def deploy(
255256

256257

257258
@APP.command()
258-
def logs(services: List[str] = typer.Argument(None, help="Services to follow (default preset)") ):
259+
def logs(services: List[str] = typer.Argument(None, help="Services to follow (default preset)")):
259260
"""Follow logs for services (docker service logs -f)."""
260261
svcs = services or DEFAULT_LOG_SERVICES
261262
for svc in svcs:
@@ -363,7 +364,7 @@ def env_recreate(
363364
if resp.lower() not in ("y", "yes"):
364365
skipped.append(str(envp))
365366
continue
366-
backup = envp.with_suffix(envp.suffix + f".bak.{int(os.times().elapsed)}")
367+
backup = envp.with_suffix(envp.suffix + f".bak.{int(time.time())}")
367368
shutil.copy2(envp, backup)
368369
shutil.copy2(ex, envp)
369370
overwritten.append(str(envp))
@@ -400,7 +401,7 @@ def secrets_decrypt(
400401
output_path.parent.mkdir(parents=True, exist_ok=True)
401402
# Write directly to file to avoid secrets in stdout
402403
with output_path.open("wb") as fh:
403-
proc = subprocess.run(["sops", "-d", str(input_path)], check=True, stdout=fh)
404+
subprocess.run(["sops", "-d", str(input_path)], check=True, stdout=fh)
404405
console.print(f"[green]Decrypted[/green] -> {output_path}")
405406

406407

0 commit comments

Comments
 (0)