]> Cypherpunks repositories - gostls13.git/commitdiff
goinstall: let git/hg/svn create the final directory element
authorRuss Cox <rsc@golang.org>
Sun, 21 Mar 2010 05:38:06 +0000 (22:38 -0700)
committerRuss Cox <rsc@golang.org>
Sun, 21 Mar 2010 05:38:06 +0000 (22:38 -0700)
R=r
CC=golang-dev
https://golang.org/cl/634044

src/cmd/goinstall/download.go

index 67f389abac190826fe771857dc7e14e117bec132..13a2f65ab855ecdd63a4bebbb14b54060cc9fb97 100644 (file)
@@ -9,6 +9,7 @@ package main
 import (
        "http"
        "os"
+       "path"
        "regexp"
        "strings"
 )
@@ -130,7 +131,8 @@ func vcsCheckout(vcs *vcs, dst, repo, dashpath string) os.Error {
                return os.ErrorString("not a directory: " + dst)
        }
        if err != nil {
-               if err := os.MkdirAll(dst, 0777); err != nil {
+               parent, _ := path.Split(dst)
+               if err := os.MkdirAll(parent, 0777); err != nil {
                        return err
                }
                if err := run("/", nil, vcs.cmd, vcs.clone, repo, dst); err != nil {