From 7fb593eb770251fec5877592321f83bd3f384d8b Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Thu, 26 Oct 2023 22:18:52 +0100 Subject: [PATCH] Allow the feature to be a relative path (#358) --- cmd/run_feature.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/run_feature.go b/cmd/run_feature.go index e9fc435f..10a773d4 100644 --- a/cmd/run_feature.go +++ b/cmd/run_feature.go @@ -4,6 +4,7 @@ import ( "fmt" "io/fs" "path/filepath" + "strings" "github.com/temporalio/features/harness/go/cmd" "golang.org/x/mod/semver" @@ -39,6 +40,7 @@ func (r *Runner) GlobFeatures(patterns []string) ([]*RunFeature, error) { if len(patterns) > 0 { foundMatch := false for _, pattern := range patterns { + pattern = strings.TrimPrefix(pattern, "features/") match, err := filepath.Match(pattern, dir) if !match && err == nil { match, err = filepath.Match(pattern, dir+"/feature."+r.config.Lang)