Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Commit

Permalink
Support new golang path
Browse files Browse the repository at this point in the history
  • Loading branch information
unknwon committed Nov 12, 2014
1 parent 8f06415 commit 0b09ce5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -4,4 +4,6 @@
repos/
vendor/
.vendor/
.idea/
.idea/
gopm.sublime-project
gopm.sublime-workspace
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/bin.go
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/lib.go
Expand Up @@ -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())
Expand Down
3 changes: 2 additions & 1 deletion modules/doc/utils.go
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion modules/setting/setting.go
Expand Up @@ -35,7 +35,7 @@ type Option struct {
}

const (
VERSION = 201410090
VERSION = 201411120
VENDOR = ".vendor"
GOPMFILE = ".gopmfile"
PKGNAMELIST = "pkgname.list"
Expand Down Expand Up @@ -86,6 +86,7 @@ var (
"gitcafe.com": 3,
"launchpad.net": 2,
"labix.org": 3,
"golang.org": 3,
}
CommonRes = []string{"views", "templates", "static", "public", "conf"}
)
Expand Down

0 comments on commit 0b09ce5

Please sign in to comment.