Skip to content

Auto-clone templates on first use; portable git auto-commit#104

Merged
MrTango merged 3 commits into
masterfrom
MrTango/auto-clone-templates
May 23, 2026
Merged

Auto-clone templates on first use; portable git auto-commit#104
MrTango merged 3 commits into
masterfrom
MrTango/auto-clone-templates

Conversation

@MrTango
Copy link
Copy Markdown
Contributor

@MrTango MrTango commented May 23, 2026

Summary

  • Clone copier-templates automatically on first use of create, add and -l, so a freshly installed plonecli works without a manual plonecli update first.
  • Store the templates local_path home-relative (~/...) in config.toml so the same config works across machines and containers with a different $HOME. Paths outside home stay absolute.
  • Auto-commit by default: create initialises a git repo and commits the generated package; add commits each subtemplate run. Opt out per run with --no-git or globally via auto_commit = false.

Test plan

  • tests/test_config.py covers home-relative path collapse, absolute paths outside home, and reload under a different $HOME
  • tests/test_plonecli.py covers first-run clone before template resolution
  • tests/test_git.py covers git auto-commit behaviour

MrTango added 3 commits May 22, 2026 17:53
Initialise a git repo on create and commit the result of every template
run, restoring bobtemplates.plone's auto-commit behaviour. Opt out per run
with --no-git or globally via auto_commit=false in ~/.plonecli/config.toml.

Warn and prompt (default: cancel) before running create/add/setup on a repo
with uncommitted changes; non-interactive runs (--defaults or no tty) print
the warning but proceed.
create/add/-l now clone copier-templates before reading the registry, so a
freshly installed plonecli works without a manual 'plonecli update'.

save_config writes local_path as ~/... when under HOME, keeping config.toml
portable across machines and containers with a different $HOME.
@MrTango MrTango merged commit abdb416 into master May 23, 2026
6 checks passed
@MrTango MrTango deleted the MrTango/auto-clone-templates branch May 23, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant