Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d85e6f29c |
@@ -121,6 +121,14 @@ def update_message(answers: Path) -> str:
|
|||||||
return f"chore({scope}): update template to {ref}" if ref else f"chore({scope}): update template"
|
return f"chore({scope}): update template to {ref}" if ref else f"chore({scope}): update template"
|
||||||
|
|
||||||
|
|
||||||
|
def refresh_locks(part: str) -> None:
|
||||||
|
root = Path(part) if Path(part, "Makefile").is_file() else Path()
|
||||||
|
if (root / "uv.lock").is_file():
|
||||||
|
subprocess.run(["uv", "lock", "-q"], cwd=root, check=True)
|
||||||
|
if (root / "bun.lock").is_file():
|
||||||
|
subprocess.run(["bun", "install", "--silent"], cwd=root, check=True)
|
||||||
|
|
||||||
|
|
||||||
def update(args: argparse.Namespace) -> None:
|
def update(args: argparse.Namespace) -> None:
|
||||||
answers = sorted(Path(".copier").glob("*.yml"))
|
answers = sorted(Path(".copier").glob("*.yml"))
|
||||||
if args.parts:
|
if args.parts:
|
||||||
@@ -132,6 +140,7 @@ def update(args: argparse.Namespace) -> None:
|
|||||||
for file in answers:
|
for file in answers:
|
||||||
run_update(".", answers_file=str(file), unsafe=True, overwrite=True,
|
run_update(".", answers_file=str(file), unsafe=True, overwrite=True,
|
||||||
skip_answered=not args.ask, defaults=args.defaults, vcs_ref=REF)
|
skip_answered=not args.ask, defaults=args.defaults, vcs_ref=REF)
|
||||||
|
refresh_locks(file.stem)
|
||||||
if git_dirty():
|
if git_dirty():
|
||||||
subprocess.run(["git", "add", "-A"], check=True)
|
subprocess.run(["git", "add", "-A"], check=True)
|
||||||
subprocess.run(["git", "commit", "-qm", update_message(file)], check=True)
|
subprocess.run(["git", "commit", "-qm", update_message(file)], check=True)
|
||||||
|
|||||||
Reference in new issue
Block a user