Browse Source

Bug fixed in bin

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

10
cmd/bin.go

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

Loading…
Cancel
Save