Bootstrap Repositories #1

Closed
opened 2025-04-05 22:26:03 +00:00 by jmarya · 0 comments
Owner

Implement better bootstrap repositories.

Ability to define bootstrap actions in bootstrap.toml on main branch of bootstrap repo.

Can contain basic template questions for setup.

Can contain replace actions for text replacement.
Can contain branch actions for switching branches.
Can contain script actions with all variables passed.

Example:

bootstrap.toml:

[ask]
name = { kind = "text", prompt = "Project Name?" }
desc = { kind = "text", prompt = "Project Description?" }
amount = { kind = "number", prompt = "Amount" }
platform = { kind = "selection", options = ["desktop", "mobile"], prompt = "Select Platform" }
really = { kind = "bool", prompt = "Sure?"  }

[[actions.replace]]
from = "placeholder"
to = "name" # Variable reference

[[actions.replace]]
when = { var = "platform", "eq" = "web" }
from = "platform: desktop"
to = "platform: web"

[[actions.branch]]
when = "really"
branch = "real"

[[actions.script]]
script = "run.sh"
expose = ["name", "desc", "amount", "really"]

run.sh:

echo "Name: $name";
echo "Desc: $desc";
echo "Platform: $platform"
Implement better bootstrap repositories. Ability to define bootstrap actions in `bootstrap.toml` on `main` branch of bootstrap repo. Can contain basic template questions for setup. Can contain `replace` actions for text replacement. Can contain `branch` actions for switching branches. Can contain `script` actions with all variables passed. Example: `bootstrap.toml`: ```toml [ask] name = { kind = "text", prompt = "Project Name?" } desc = { kind = "text", prompt = "Project Description?" } amount = { kind = "number", prompt = "Amount" } platform = { kind = "selection", options = ["desktop", "mobile"], prompt = "Select Platform" } really = { kind = "bool", prompt = "Sure?" } [[actions.replace]] from = "placeholder" to = "name" # Variable reference [[actions.replace]] when = { var = "platform", "eq" = "web" } from = "platform: desktop" to = "platform: web" [[actions.branch]] when = "really" branch = "real" [[actions.script]] script = "run.sh" expose = ["name", "desc", "amount", "really"] ``` `run.sh`: ```shell echo "Name: $name"; echo "Desc: $desc"; echo "Platform: $platform" ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: jmarya/g#1
No description provided.