Skip to content

Commit

Permalink
feat(postrun): show module when ran, quiet mise trust
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredallard committed Dec 22, 2024
1 parent 4af09eb commit e684ac3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Binary file modified bun.lockb
Binary file not shown.
6 changes: 4 additions & 2 deletions internal/codegen/stencil.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,14 @@ func (s *Stencil) PostRun(ctx context.Context, log slogext.Logger) error {
// prevent more cases from being added to the code.
if _, err := os.Stat(".mise.toml"); err == nil {
// Check if 'mise' is in path to ensure this is less likely to fail.
//
//nolint:errcheck // Why: Checking path only
if misePath, _ := exec.LookPath("mise"); misePath != "" {
postRunCommands = append(postRunCommands, &postRunCommand{
Module: "stencil",
Spec: &configuration.PostRunCommandSpec{
Name: "mise: trust config",
Command: "mise trust",
Command: "mise trust --quiet",
},
})
}
Expand All @@ -314,7 +316,7 @@ func (s *Stencil) PostRun(ctx context.Context, log slogext.Logger) error {
}

for _, prc := range postRunCommands {
log.Infof(" - %s", prc.Spec.Name)
log.Infof(" - %s (source: %s)", prc.Spec.Name, prc.Module)
cmd := cmdexec.CommandContext(ctx, "/usr/bin/env", "bash", "-c", prc.Spec.Command)
cmd.UseOSStreams(true)
if err := cmd.Run(); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions stencil.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ modules:
- name: github.com/rgst-io/stencil-golang
url: https://github.com/rgst-io/stencil-golang
version:
commit: 2caa391c628957e7477ffd9fcd1c52a3029b254d
tag: v1.2.0
commit: 0789456ca8f2952abfb6d4d9c5492a6fe6345e13
tag: v1.3.1
files:
- name: .cliff.toml
template: .cliff.toml.tpl
Expand Down

0 comments on commit e684ac3

Please sign in to comment.