Skip to content

Commit

Permalink
Update confort: check go.mod file
Browse files Browse the repository at this point in the history
  • Loading branch information
daichitakahashi committed Jan 17, 2023
1 parent 9b6a939 commit f7ca9e2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ func resolveGoModDir(ctx context.Context) (string, error) {
// If go.mod doesn't exist, use current directory.
return ".", nil
}
_, err = os.Stat(v)
if err != nil {
if os.IsNotExist(err) {
return "", fmt.Errorf("go.mod not found: %s", v)
}
return "", fmt.Errorf("failed to check go.mod: %w", err)
}
return filepath.Dir(v), nil
}

Expand Down Expand Up @@ -274,7 +281,6 @@ func (c *ComposeProject) Up(ctx context.Context, service string) (*Service, erro
switch s[0].State {
case "running":
case "created", "exiting":
fmt.Println(s[0].State)
doUp = true
case "paused":
return nil, fmt.Errorf("cannot start %q, unpause is not supported", service)
Expand Down

0 comments on commit f7ca9e2

Please sign in to comment.