Skip to content

Commit

Permalink
test: fix execute with subpath test on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
majori committed Nov 15, 2024
1 parent 1cd9fb8 commit f8f3e24
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/execute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"path/filepath"
"runtime"
"strings"

"github.com/cucumber/godog"
Expand Down Expand Up @@ -63,6 +64,11 @@ func iExecuteRemoteRecipe(ctx context.Context, repository string) (context.Conte

func recipesWillBeExecutedToTheSubPath(ctx context.Context, path string) (context.Context, error) {
additionalFlags := ctx.Value(cmdAdditionalFlagsCtxKey{}).(map[string]string)

if runtime.GOOS == "windows" && path[0] == '/' {
path = filepath.Clean(filepath.Join("C:/", path[1:]))
}

additionalFlags["subpath"] = path

return ctx, nil
Expand Down

0 comments on commit f8f3e24

Please sign in to comment.