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:
20
task_test.go
20
task_test.go
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user