Commit 3c6a7b3f authored by Alex Brainman's avatar Alex Brainman

go/build: use os.MkdirAll to create directories

Replaces "mkdir -p ..." command, as Windows mkdir command
does not support -p flag. Also, is simpler and faster then
launching new process.

R=golang-dev, mattn.jp, adg, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4626087
parent 7b79b3b2
......@@ -213,6 +213,14 @@ func (c *Cmd) String() string {
// Run executes the Cmd.
func (c *Cmd) Run() os.Error {
if c.Args[0] == "mkdir" {
for _, p := range c.Output {
if err := os.MkdirAll(p, 0777); err != nil {
return fmt.Errorf("command %q: %v", c, err)
}
}
return nil
}
out := new(bytes.Buffer)
cmd := exec.Command(c.Args[0], c.Args[1:]...)
cmd.Dir = c.Dir
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment