Skip to content

add post_commands: runs after packages + file_associations - #31

Merged
tommyjcarpenter merged 1 commit into
mainfrom
post-commands
May 9, 2026
Merged

add post_commands: runs after packages + file_associations#31
tommyjcarpenter merged 1 commit into
mainfrom
post-commands

Conversation

@tommyjcarpenter

Copy link
Copy Markdown
Owner

Summary

  • New top-level config section `post_commands` (same shape as `commands`) that runs at the end of the bootstrap flow instead of the start
  • Schema: factor the per-OS commands shape into a reusable `commands_section` definition; `commands` and `post_commands` both reference it
  • `utils.cmds` takes a new `section_key` arg (defaults to `"commands"`) so the same plumbing handles both phases

Why

The motivating case is a step that depends on a package already being installed — e.g. registering a font file that scoop dropped on disk but didn't put in the user font registry. Without `post_commands` you'd have to either bundle install + post-install into one giant cmd (multi-line PowerShell quoted into JSON, pretty miserable to maintain) or split the work across two bootstrap runs.

Order is now:
```
mkdirs → links → commands → prereq_packages → packages →
file_associations → post_commands
```

Test plan

  • `ruff check` + `ruff format --check` clean
  • `sample_config.json` validates against the new schema
  • Manual: dotfiles consumes `post_commands` for the VictorMono NFM font registration (separate dotfiles change, not in this PR)

Same shape as `commands`, just sequenced at the end of the bootstrap
flow instead of the start. The motivating case is a step that depends
on a package already being installed — e.g. registering a font file
that scoop dropped on disk but didn't put in the user font registry.
Without post_commands you'd have to either: (a) bundle install + the
post-install step into one cmd that does its own scoop install (and
tolerate a multi-line PowerShell quoted into JSON), or (b) split the
work across two bootstrap runs. Both are bad.

Schema-wise, factor out the per-OS commands shape into a reusable
`commands_section` definition; both `commands` and `post_commands`
now reference it.

Signed-off-by: Tommy Carpenter <9419125+tommyjcarpenter@users.noreply.github.com>
@tommyjcarpenter
tommyjcarpenter merged commit ba6b69f into main May 9, 2026
5 checks passed
@tommyjcarpenter
tommyjcarpenter deleted the post-commands branch May 9, 2026 22:48
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