1
0
mirror of https://github.com/go-task/task.git synced 2025-11-29 22:48:03 +02:00

fix: make sure USER_WORKING_DIR works corrently with includes (#1309)

Closes #1046
Closes #1205
Closes #1250
Closes #1293
Closes #1274
Closes #1309
Closes #1312

Co-authored-by: Marcus Spading <ms@fragmentum.net>
This commit is contained in:
Andrey Nering
2023-08-26 18:06:50 -03:00
committed by GitHub
parent 6102900060
commit e96712b020
9 changed files with 78 additions and 11 deletions

View File

@@ -1940,6 +1940,26 @@ func TestUserWorkingDirectory(t *testing.T) {
assert.Equal(t, fmt.Sprintf("%s\n", wd), buff.String())
}
func TestUserWorkingDirectoryWithIncluded(t *testing.T) {
wd, err := os.Getwd()
require.NoError(t, err)
wd = filepathext.SmartJoin(wd, "testdata/user_working_dir_with_includes/somedir")
var buff bytes.Buffer
e := task.Executor{
UserWorkingDir: wd,
Dir: "testdata/user_working_dir_with_includes",
Stdout: &buff,
Stderr: &buff,
}
require.NoError(t, err)
require.NoError(t, e.Setup())
require.NoError(t, e.Run(context.Background(), taskfile.Call{Task: "included:echo"}))
assert.Equal(t, fmt.Sprintf("%s\n", wd), buff.String())
}
func TestPlatforms(t *testing.T) {
var buff bytes.Buffer
e := task.Executor{