-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
In a pipe.Script context, my expectation is that every step runs sequentially, where earlier steps complete before later steps start.
I discovered that a few functions like pipe.MkDirAll run instantly, irrespective of their position in the pipe.Script.
For example:
pipe.Script(
pipe.System("sleep 2 && test ! -d newdir"), // wait then fail.
pipe.MkDirAll("newdir/subdir", 0755), // runs before first step completes
),
If my understanding is correct, it looks like this behavior could be changed by using a TaskFunc in the implementation of MkDirAll.
For example:
func syncMkDirAll(dir string, perm os.FileMode) pipe.Pipe {
return pipe.TaskFunc(func(s *pipe.State) error {
return os.MkdirAll(s.Path(dir), perm)
})
}
What do you think of making MkDir* a TaskFunc by default?
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels