Skip to content

Commit 4f0b2ce

Browse files
committed
fix: show post-install listing in all execution paths and update error message
- Restructure stepPostInstall so command listing is shown for all modes that proceed to execute (interactive, dry-run, silent+allow-post-install) - Update shellIdentifierRe error message to mention dots
1 parent d791b29 commit 4f0b2ce

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

internal/installer/installer.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -731,22 +731,22 @@ func stepPostInstall(cfg *config.Config) error {
731731

732732
commands := cfg.RemoteConfig.PostInstall
733733

734-
if cfg.DryRun {
735-
// dry-run: show commands below without confirmation
736-
} else if cfg.Silent || !system.HasTTY() {
734+
if !cfg.DryRun && (cfg.Silent || !system.HasTTY()) {
737735
if !cfg.AllowPostInstall {
738736
ui.Warn("Skipping post-install script in silent mode (use --allow-post-install to enable)")
739737
fmt.Println()
740738
return nil
741739
}
742-
} else {
743-
// Show commands before interactive confirmation
744-
ui.Info(fmt.Sprintf("%d command(s) to run:", len(commands)))
745-
for i, cmd := range commands {
746-
fmt.Printf(" %d. %s\n", i+1, cmd)
747-
}
748-
fmt.Println()
740+
}
741+
742+
// Show command listing for all modes that proceed (interactive, dry-run, silent+allowed)
743+
ui.Info(fmt.Sprintf("%d command(s) to run:", len(commands)))
744+
for i, cmd := range commands {
745+
fmt.Printf(" %d. %s\n", i+1, cmd)
746+
}
747+
fmt.Println()
749748

749+
if !cfg.DryRun && !cfg.Silent && system.HasTTY() {
750750
run, err := ui.Confirm("Run post-install script?", true)
751751
if err != nil {
752752
return err

internal/shell/shell.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func validateShellIdentifier(value, label string) error {
1818
return nil
1919
}
2020
if !shellIdentifierRe.MatchString(value) {
21-
return fmt.Errorf("invalid %s: %q (only alphanumerics, hyphens, underscores allowed)", label, value)
21+
return fmt.Errorf("invalid %s: %q (only alphanumerics, hyphens, underscores, dots allowed)", label, value)
2222
}
2323
return nil
2424
}

0 commit comments

Comments
 (0)