diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-19 19:49:08 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-19 19:49:08 +0200 |
| commit | b6965ac87bfffb610bf099812562951cc154738e (patch) | |
| tree | 0431d2466731a9bc4084843298afb5268ca38985 /examples/tools/clone.toml | |
| parent | 6cb503a50fc49ec26af0f0624141a0c97e75cca4 (diff) | |
| download | desktop-assistant-b6965ac87bfffb610bf099812562951cc154738e.tar.gz desktop-assistant-b6965ac87bfffb610bf099812562951cc154738e.zip | |
clone tool: clone a public repo into the host's folder
A public URL is cloned into ~/Programming/GIT/<host-folder>/<repo>, the folder chosen by host from ~/.config/desktop-assistant/clone-hosts (github.com, gitlab.com, forge.slackware.nl seeded). An unknown host or an already-cloned repo stops and asks with a concrete action; approving a new host folder appends it to the map, so later clones of that host ask nothing. Update pulls with --ff-only, never clones over the folder.
test-clone.sh stubs git and uses a scratch tree and map.
Diffstat (limited to 'examples/tools/clone.toml')
| -rw-r--r-- | examples/tools/clone.toml | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/tools/clone.toml b/examples/tools/clone.toml new file mode 100644 index 0000000..0862165 --- /dev/null +++ b/examples/tools/clone.toml @@ -0,0 +1,15 @@ +description = "Clone a public git repository into the user's project tree. The folder comes from the host: github.com -> GITHUB, gitlab.com -> GITLAB, forge.slackware.nl -> FORGE, plus hosts remembered from earlier clones. Call it with url and nothing else; when the host is known and the repo is not there yet it clones straight away. If it answers that the host has no folder, or that the repo is already cloned, it did nothing: ask the user exactly as that answer says, then call again with the to or update it names. Never clone a repo under a different name when it is already there; offer to update it." +command = ["clone.sh", "{url}", "{to}", "{update}"] +timeout = 300 + +[params.url] +type = "string" +description = "Repository URL, e.g. https://github.com/owner/repo.git" + +[params.to] +type = "string" +description = "Only when the user approved a new host folder: the folder name (e.g. CODEBERG). Empty otherwise." + +[params.update] +type = "string" +description = "1 to pull an already-cloned repository. Empty otherwise." |
