|
@@ -107,18 +107,12 @@ func init() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func apply(_ *types.GetAuthenticatedUserResponse, client *api.Client, _ []string) error {
|
|
func apply(_ *types.GetAuthenticatedUserResponse, client *api.Client, _ []string) error {
|
|
|
- var fileBytes []byte
|
|
|
|
|
- var err error
|
|
|
|
|
- if porterYAML == "" {
|
|
|
|
|
|
|
+ fileBytes, err := ioutil.ReadFile(porterYAML)
|
|
|
|
|
+ if err != nil {
|
|
|
stackName := os.Getenv("PORTER_STACK_NAME")
|
|
stackName := os.Getenv("PORTER_STACK_NAME")
|
|
|
if stackName == "" {
|
|
if stackName == "" {
|
|
|
return fmt.Errorf("a valid porter.yaml file must be specified. Run porter apply --help for more information")
|
|
return fmt.Errorf("a valid porter.yaml file must be specified. Run porter apply --help for more information")
|
|
|
}
|
|
}
|
|
|
- } else {
|
|
|
|
|
- fileBytes, err = ioutil.ReadFile(porterYAML)
|
|
|
|
|
- if err != nil {
|
|
|
|
|
- return fmt.Errorf("error reading porter.yaml: %w", err)
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
var previewVersion struct {
|
|
var previewVersion struct {
|