From 0b09ce533553f9be880d4380d927b09b12823359 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 12 Nov 2014 07:23:24 -0500 Subject: [PATCH] Support new golang path --- .gitignore | 4 +++- README.md | 2 +- cmd/bin.go | 2 +- lib/lib.go | 2 +- modules/doc/utils.go | 3 ++- modules/setting/setting.go | 3 ++- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index fed59a4..359f2ad 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ repos/ vendor/ .vendor/ -.idea/ \ No newline at end of file +.idea/ +gopm.sublime-project +gopm.sublime-workspace \ No newline at end of file diff --git a/README.md b/README.md index 93f6727..07d3879 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ USAGE: Gopm [global options] command [command options] [arguments...] VERSION: - 0.8.4.1006 Beta + 0.8.5.1112 Beta COMMANDS: list list all dependencies of current project diff --git a/cmd/bin.go b/cmd/bin.go index 2f8e844..36b5a5d 100644 --- a/cmd/bin.go +++ b/cmd/bin.go @@ -177,7 +177,7 @@ func runBin(ctx *cli.Context) { movePath := oldWorkDir if ctx.IsSet("dir") { movePath = ctx.String("dir") - } else if strings.HasPrefix(n.ImportPath, "code.google.com/p/go.tools/cmd/") { + } else if strings.HasPrefix(n.ImportPath, "golang.org/x/tools/cmd/") { movePath = path.Join(runtime.GOROOT(), "pkg/tool", runtime.GOOS+"_"+runtime.GOARCH) log.Info("Command executed successfully!") fmt.Println("Binary has been built into: " + movePath) diff --git a/lib/lib.go b/lib/lib.go index b7ee91a..cef2103 100644 --- a/lib/lib.go +++ b/lib/lib.go @@ -27,7 +27,7 @@ import ( "github.com/gpmgo/gopm/modules/setting" ) -const APP_VER = "0.8.4.1009 Beta" +const APP_VER = "0.8.5.1112 Beta" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/modules/doc/utils.go b/modules/doc/utils.go index ed82485..e081ece 100644 --- a/modules/doc/utils.go +++ b/modules/doc/utils.go @@ -77,7 +77,8 @@ func GetRootPath(name string) string { // IsGoRepoPath returns true if package is from standard library. func IsGoRepoPath(name string) bool { - return base.IsDir(path.Join(runtime.GOROOT(), "src/pkg", name)) + return base.IsDir(path.Join(runtime.GOROOT(), "src/pkg", name)) || + base.IsDir(path.Join(runtime.GOROOT(), "src", name)) } // ListImports checks and returns a list of imports of given import path and options. diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 5c6d477..68055a2 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -35,7 +35,7 @@ type Option struct { } const ( - VERSION = 201410090 + VERSION = 201411120 VENDOR = ".vendor" GOPMFILE = ".gopmfile" PKGNAMELIST = "pkgname.list" @@ -86,6 +86,7 @@ var ( "gitcafe.com": 3, "launchpad.net": 2, "labix.org": 3, + "golang.org": 3, } CommonRes = []string{"views", "templates", "static", "public", "conf"} )