Skip to content

Commit

Permalink
Check the default env file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
antham committed Jul 17, 2024
1 parent 3193f53 commit e192b55
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/workspace/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,13 @@ func (s WorkspaceManager) getWorkspace(name string) (Workspace, error) {
if app != s.shell {
return Workspace{}, fmt.Errorf(`the "%s" app is not supported for this workspace, it works with "%s"`, app, s.shell)
}
_, err = os.ReadFile(s.resolveEnvFile(name, defaultEnv))
if os.IsNotExist(err) {
return Workspace{}, errors.New("the default env file of the workspace is corrupted")

Check warning on line 494 in internal/workspace/workspace.go

View check run for this annotation

Codecov / codecov/patch

internal/workspace/workspace.go#L494

Added line #L494 was not covered by tests
}
content, err := os.ReadFile(s.resolveFunctionFile(name))
if os.IsNotExist(err) {
return Workspace{}, errors.New("the workspace does not exist")
return Workspace{}, errors.New("the function file of the workspace is corrupted")

Check warning on line 498 in internal/workspace/workspace.go

View check run for this annotation

Codecov / codecov/patch

internal/workspace/workspace.go#L498

Added line #L498 was not covered by tests
}
if err != nil {
return Workspace{}, err
Expand Down

0 comments on commit e192b55

Please sign in to comment.