Skip to content

Commit 27529f9

Browse files
Aurelioloclaude
andcommitted
refactor: extract helpers and split files for CLI update/config commands
Address review findings: extract compose functions to update_compose.go, split updater_test.go into focused test files, extract helpers to bring all functions under 50 lines (handleDeclinedCompose, downloadAndApplyCLI, performRestart, isDevChannelMismatch, writeTempBinary, windowsPreReplace). Add SecurePath guard to config get for consistency with config show. Pre-reviewed by 4 agents, 11 findings addressed Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ef63517 commit 27529f9

7 files changed

Lines changed: 1099 additions & 1038 deletions

File tree

cli/cmd/config.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ func runConfigShow(cmd *cobra.Command, _ []string) error {
118118
}
119119

120120
// gettableConfigKeys lists all keys supported by `config get`.
121+
// Keep in sync with the Long help text on configGetCmd.
121122
var gettableConfigKeys = []string{
122123
"auto_cleanup", "backend_port", "channel", "image_tag",
123124
"log_level", "memory_backend", "persistence_backend",
@@ -132,6 +133,10 @@ func runConfigGet(cmd *cobra.Command, args []string) error {
132133
key := args[0]
133134
dir := resolveDataDir()
134135

136+
if _, err := config.SecurePath(dir); err != nil {
137+
return fmt.Errorf("invalid data directory: %w", err)
138+
}
139+
135140
state, err := config.Load(dir)
136141
if err != nil {
137142
return fmt.Errorf("loading config: %w", err)

0 commit comments

Comments
 (0)