Skip to content

Commit 7820d6d

Browse files
fix(installer): run shell, dotfiles, and macos steps in custom config installs
Custom config installs (openboot -u <user>) were only installing packages and then returning early with a misleading message. Shell setup, dotfiles cloning, and macOS preferences were never applied. - Add DotfilesURL field to Config to carry RemoteConfig.DotfilesRepo into the dotfiles step without relying on env var side effects - stepDotfiles now falls back to cfg.DotfilesURL when OPENBOOT_DOTFILES is not set, so dotfiles_repo in remote configs is respected - runCustomInstall now calls stepShell, stepDotfiles, and stepMacOS with soft-error aggregation matching runInteractiveInstall behaviour - npm errors are now collected into softErrs instead of being silently dropped after printing Fixes #3 Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
1 parent e6893d1 commit 7820d6d

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

internal/config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ type Config struct {
4444
SnapshotShell *SnapshotShellConfig
4545
SnapshotGit *SnapshotGitConfig
4646
SnapshotDotfiles string
47+
DotfilesURL string
4748
}
4849

4950
type SnapshotShellConfig struct {

internal/installer/installer.go

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,45 @@ func runCustomInstall(cfg *config.Config) error {
129129
return err
130130
}
131131

132+
var softErrs []error
133+
132134
if len(cfg.RemoteConfig.Npm) > 0 {
133135
if err := stepInstallNpmWithRetry(cfg); err != nil {
134136
ui.Error(fmt.Sprintf("npm package installation failed: %v", err))
137+
softErrs = append(softErrs, fmt.Errorf("npm: %w", err))
135138
}
136139
}
137140

141+
if cfg.RemoteConfig.DotfilesRepo != "" {
142+
cfg.DotfilesURL = cfg.RemoteConfig.DotfilesRepo
143+
}
144+
145+
if err := stepShell(cfg); err != nil {
146+
ui.Error(fmt.Sprintf("Shell setup failed: %v", err))
147+
softErrs = append(softErrs, fmt.Errorf("shell: %w", err))
148+
}
149+
150+
if err := stepDotfiles(cfg); err != nil {
151+
ui.Error(fmt.Sprintf("Dotfiles setup failed: %v", err))
152+
softErrs = append(softErrs, fmt.Errorf("dotfiles: %w", err))
153+
}
154+
155+
if err := stepMacOS(cfg); err != nil {
156+
ui.Error(fmt.Sprintf("macOS configuration failed: %v", err))
157+
softErrs = append(softErrs, fmt.Errorf("macos: %w", err))
158+
}
159+
160+
fmt.Println()
161+
ui.Header("Installation Complete!")
138162
fmt.Println()
139-
ui.Muted("Dotfiles and shell setup will be handled by the install script.")
163+
ui.Success("OpenBoot has successfully configured your Mac.")
140164
fmt.Println()
165+
166+
if len(softErrs) > 0 {
167+
fmt.Println()
168+
ui.Warn(fmt.Sprintf("%d setup step(s) had errors — run 'openboot doctor' to diagnose.", len(softErrs)))
169+
return errors.Join(softErrs...)
170+
}
141171
return nil
142172
}
143173

@@ -498,6 +528,9 @@ func stepDotfiles(cfg *config.Config) error {
498528
fmt.Println()
499529

500530
dotfilesURL := dotfiles.GetDotfilesURL()
531+
if dotfilesURL == "" {
532+
dotfilesURL = cfg.DotfilesURL
533+
}
501534

502535
if cfg.Dotfiles == "" && dotfilesURL == "" {
503536
if cfg.Silent || (cfg.DryRun && !system.HasTTY()) {

0 commit comments

Comments
 (0)