Browse Source

Merge branch 'master' of https://github.com/gpmgo/gopm

pull/103/head
Unknown 11 years ago
parent
commit
a7845ffe2c
  1. 10
      cmd/bin.go

10
cmd/bin.go

@ -78,11 +78,13 @@ func runBin(ctx *cli.Context) {
// Parse package version.
info := ctx.Args()[0]
pkgPath := info
tp, ver := "", ""
node := doc.NewNode(pkgPath, pkgPath, doc.BRANCH, "", true)
var err error
if i := strings.Index(info, "@"); i > -1 {
pkgPath = info[:i]
tp, ver = validPath(info[i+1:])
node.ImportPath = pkgPath
node.DownloadURL = pkgPath
node.Type, node.Value = validPath(info[i+1:])
}
// Check package name.
@ -90,13 +92,11 @@ func runBin(ctx *cli.Context) {
pkgPath = doc.GetPkgFullPath(pkgPath)
}
node := doc.NewNode(pkgPath, pkgPath, tp, ver, true)
// Get code.
downloadPackages(ctx, []*doc.Node{node})
// Check if previous steps were successful.
repoPath := installRepoPath + "/" + pkgPath + versionSuffix(ver)
repoPath := installRepoPath + "/" + pkgPath + versionSuffix(node.Value)
if !com.IsDir(repoPath) {
log.Error("bin", "Cannot continue command:")
log.Fatal("", "\tPrevious steps weren't successful")

Loading…
Cancel
Save