-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fail when cluster commands are called without a proper workspace set #9
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,9 @@ package orb | |
|
||
import ( | ||
"errors" | ||
"fmt" | ||
"github.com/omnigres/cli/internal/fileutils" | ||
"github.com/spf13/viper" | ||
"os" | ||
"path/filepath" | ||
) | ||
|
||
|
@@ -62,12 +62,7 @@ func LoadConfig(path string) (cfg *Config, err error) { | |
v.SetConfigFile(filepath.Join(path, "omnigres.yaml")) | ||
err = v.ReadInConfig() | ||
if err != nil { | ||
if _, ok := err.(*os.PathError); ok { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this change may affect This assumes we agree that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was actually dropping that behavior (running on yaml-less dirs) for the sake of simplicity. I thought |
||
cfg = NewConfig() | ||
err = nil | ||
return | ||
} | ||
return | ||
return nil, fmt.Errorf("omnigres.yaml not found in %s. Try setting a different workspace with -w or running omnigres init to create a new project config.", path) | ||
} | ||
|
||
cfg = NewConfig() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change is a stowaway here, just was testing and thought it would be nice to cover this case even if remote.