Skip to content

Commit

Permalink
cmd/cue: fix find-files testscript builtin to use relative directory …
Browse files Browse the repository at this point in the history
…paths

Otherwise, `find-files .` used the current directory of the process,
that being the directory of the package being tested,
rather than the script's current directory such as ${WORK}.

The following commits use this builtin for `cue exp gengotypes`,
which exposed this bug.

Signed-off-by: Daniel Martí <[email protected]>
Change-Id: Iad745bebd2f6892dca21e863464ef260f55c9dde
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1206582
Reviewed-by: Paul Jolly <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
mvdan committed Jan 3, 2025
1 parent 7da6f24 commit 41d0797
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/cue/cmd/script_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ func TestScript(t *testing.T) {
out := ts.Stdout()
workdir := ts.Getenv("WORK")
for _, arg := range args {
err := filepath.WalkDir(arg, func(path string, d fs.DirEntry, err error) error {
path := ts.MkAbs(arg)
err := filepath.WalkDir(path, func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
Expand Down

0 comments on commit 41d0797

Please sign in to comment.