Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions cli/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/Aureliolo/synthorg/cli/internal/health"
"github.com/Aureliolo/synthorg/cli/internal/ui"
"github.com/Aureliolo/synthorg/cli/internal/verify"
"github.com/Aureliolo/synthorg/cli/internal/version"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -43,8 +42,11 @@ func runStart(cmd *cobra.Command, args []string) error {
return err
}
composePath := filepath.Join(safeDir, "compose.yml")
if _, err := os.Stat(composePath); errors.Is(err, os.ErrNotExist) {
return fmt.Errorf("compose.yml not found in %s — run 'synthorg init' first", safeDir)
if _, err := os.Stat(composePath); err != nil {
Comment thread Dismissed
if errors.Is(err, os.ErrNotExist) {
return fmt.Errorf("compose.yml not found in %s -- run 'synthorg init' first", safeDir)
}
return fmt.Errorf("checking compose.yml: %w", err)
}

out := ui.NewUI(cmd.OutOrStdout())
Expand Down Expand Up @@ -121,7 +123,7 @@ func verifyAndPinImages(ctx context.Context, cmd *cobra.Command, state config.St
return fmt.Errorf("digest pin map: %w", err)
}

if err := writeDigestPinnedCompose(state, pins, safeDir, version.Version); err != nil {
if err := writeDigestPinnedCompose(state, pins, safeDir); err != nil {
return fmt.Errorf("pinning verified digests: %w", err)
}

Expand All @@ -137,9 +139,8 @@ func verifyAndPinImages(ctx context.Context, cmd *cobra.Command, state config.St
//
// Uses atomic write (temp file + rename) to prevent a partial write from
// corrupting the compose file if the process is interrupted.
func writeDigestPinnedCompose(state config.State, digestPins map[string]string, safeDir, cliVersion string) error {
func writeDigestPinnedCompose(state config.State, digestPins map[string]string, safeDir string) error {
params := compose.ParamsFromState(state)
params.CLIVersion = cliVersion
params.DigestPins = digestPins

composeYAML, err := compose.Generate(params)
Expand Down
Loading
Loading