From 8ce4b5f25266d37afec733f72376ab293fc5d520 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 10 Dec 2013 17:50:30 -0500 Subject: [PATCH] Fixed bug: when use option -g and pkg exists in GOPATH but does not in repos, err shows dir not exists in repos --- cmd/get.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/get.go b/cmd/get.go index 08ab86b08..c6b78532b 100644 --- a/cmd/get.go +++ b/cmd/get.go @@ -194,7 +194,7 @@ func downloadPackages(ctx *cli.Context, nodes []*doc.Node) { log.Trace("Skipped installed package: %s@%s:%s", n.ImportPath, n.Type, doc.CheckNodeValue(n.Value)) - if ctx.Bool("gopath") && !com.IsExist(gopathDir) { + if ctx.Bool("gopath") && com.IsExist(installPath) { copyToGopath(installPath, gopathDir) log.Log("Package copied to GOPATH: %s", n.ImportPath) } @@ -249,7 +249,7 @@ func downloadPackages(ctx *cli.Context, nodes []*doc.Node) { doc.LocalNodes.SetValue(nod.RootPath, "value", nod.Revision) } - if ctx.Bool("gopath") && !com.IsExist(gopathDir) { + if ctx.Bool("gopath") && com.IsExist(installPath) { copyToGopath(installPath, gopathDir) log.Log("Package copied to GOPATH: %s", n.ImportPath) }