Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle potential errors during new deployment flow #2422

Merged
merged 5 commits into from
Nov 12, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Set entrypoint first in normalizeConfig
  • Loading branch information
dotNomad committed Nov 8, 2024
commit fa7a1ab56cc56d2bfcb1e9173cf0a824cebf7906
21 changes: 11 additions & 10 deletions internal/initialize/initialize.go
Original file line number Diff line number Diff line change
@@ -125,6 +125,17 @@ func normalizeConfig(
entrypoint util.RelativePath,
log logging.Logger,
) error {
// Usually an entrypoint will be inferred.
// If not, use the specified entrypoint, or
// fall back to unknown.
if cfg.Entrypoint == "" {
cfg.Entrypoint = entrypoint.String()

if cfg.Entrypoint == "" {
cfg.Entrypoint = "unknown"
}
}

log.Info("Possible deployment type", "Entrypoint", cfg.Entrypoint, "Type", cfg.Type)
if cfg.Title == "" {
// Default title is the name of the project directory.
@@ -172,16 +183,6 @@ func normalizeConfig(
}
cfg.Comments = strings.Split(initialComment, "\n")

// Usually an entrypoint will be inferred.
// If not, use the specified entrypoint, or
// fall back to unknown.
if cfg.Entrypoint == "" {
cfg.Entrypoint = entrypoint.String()

if cfg.Entrypoint == "" {
cfg.Entrypoint = "unknown"
}
}
return nil
}