Skip to content

Commit

Permalink
fix #283: Update to consider PC_CONFIG_FILES env var
Browse files Browse the repository at this point in the history
  • Loading branch information
F1bonacc1 committed Dec 14, 2024
1 parent 53351d5 commit c510677
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/f1bonacc1/process-compose/src/types"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"os"
)

var (
Expand Down Expand Up @@ -85,5 +86,7 @@ func init() {
projectCmd.AddCommand(updateCmd)
updateCmd.Flags().StringArrayVarP(&opts.FileNames, "config", "f", config.GetConfigDefault(), "path to config files to load (env: "+config.EnvVarNameConfig+")")
updateCmd.Flags().BoolVarP(&updateVerboseOutput, "verbose", "v", updateVerboseOutput, "verbose output")
_ = updateCmd.MarkFlagRequired("config")
if os.Getenv(config.EnvVarNameConfig) == "" {
_ = updateCmd.MarkFlagRequired("config")
}
}
4 changes: 2 additions & 2 deletions src/loader/merger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ func Test_mergeProcess(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
got, err := mergeProcess(tt.args.baseProcess, tt.args.overrideProcess)
if (err != nil) != tt.wantErr {
t.Errorf("mergeProcess() error = %v, wantErr %v", err, tt.wantErr)
t.Errorf("mergeProcess() error = %+v, wantErr %+v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("mergeProcess() got = %v, want %v", got, tt.want)
t.Errorf("mergeProcess() got = %+v, want %+v", got, tt.want)
}
})
}
Expand Down

0 comments on commit c510677

Please sign in to comment.