Browse Source

Freeze gopm get code for v0.6.0

pull/103/head
Unknown 11 years ago
parent
commit
556c08fad9
  1. 9
      README.md
  2. 8
      cmd/bin.go
  3. 81
      cmd/cmd.go
  4. 17
      cmd/gen.go
  5. 136
      cmd/get.go
  6. 1
      cmd/install.go
  7. 190
      cmd/search.go
  8. 6
      cmd/update.go
  9. 14
      doc/conf.go
  10. 3
      doc/vcs.go
  11. 3
      gopm.go

9
README.md

@ -5,7 +5,9 @@ gopm - Go Package Manager
Gopm(Go Package Manager) is a Go package manage tool for search, install, update and share packages in Go. Gopm(Go Package Manager) is a Go package manage tool for search, install, update and share packages in Go.
**[Documentation](https://github.com/gpmgo/docs)** **News** The best IDE for Go development [LiteIDE](https://github.com/visualfc/liteide)(after X20) now has a simple integration of gopm!
Please see **[Documentation](https://github.com/gpmgo/docs)** before you ever start.
# Commands # Commands
@ -17,7 +19,7 @@ USAGE:
gopm [global options] command [command options] [arguments...] gopm [global options] command [command options] [arguments...]
VERSION: VERSION:
0.5.7.1202 0.6.0.1206
COMMANDS: COMMANDS:
get fetch remote package(s) and dependencies to local repository get fetch remote package(s) and dependencies to local repository
@ -29,7 +31,8 @@ COMMANDS:
help, h Shows a list of commands or help for one command help, h Shows a list of commands or help for one command
GLOBAL OPTIONS: GLOBAL OPTIONS:
--version print the version --noterm disable color output
--version, -v print the version
--help, -h show help --help, -h show help
``` ```

8
cmd/bin.go

@ -81,13 +81,7 @@ func runBin(ctx *cli.Context) {
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]
_, ver, err = validPath(info[i+1:]) _, ver = validPath(info[i+1:])
if err != nil {
log.Error("bin", "Cannot parse package version")
log.Error("", err.Error()+":")
log.Error("", "\t"+info[i+1:])
log.Help("Try 'gopm help get' to get more information")
}
} }
// Check package name. // Check package name.

81
cmd/cmd.go

@ -15,54 +15,65 @@
package cmd package cmd
import ( import (
"fmt"
"os" "os"
"strings" "strings"
"github.com/codegangsta/cli"
"github.com/gpmgo/gopm/doc"
"github.com/gpmgo/gopm/log"
) )
var ( var (
AppPath string workDir string // The path of gopm was executed.
) )
// A Command is an implementation of a go command // setup initialize common environment for commands.
// like go build or go fix. func setup(ctx *cli.Context) {
type Command struct { var err error
// Run runs the command. workDir, err = os.Getwd()
// The args are the arguments after the command name. if err != nil {
Run func(cmd *Command, args []string) log.Error("setup", "Fail to get work directory:")
log.Fatal("", "\t"+err.Error())
// UsageLine is the one-line usage message. }
// The first word in the line is taken to be the command name.
UsageLine string
// Short is the short description shown in the 'go help' output.
Short string
// Long is the long message shown in the 'go help <this-command>' output.
Long string
// Flag is a set of flags specific to this command. log.PureMode = ctx.GlobalBool("noterm")
Flags map[string]bool log.Verbose = ctx.Bool("verbose")
} }
// Name returns the command's name: the first word in the usage line. // parseTarget returns "." when target is empty string.
func (c *Command) Name() string { func parseTarget(target string) string {
name := c.UsageLine if len(target) == 0 {
i := strings.Index(name, " ") target = "."
if i >= 0 {
name = name[:i]
} }
return name return target
} }
func (c *Command) Usage() { // validPath checks if the information of the package is valid.
fmt.Fprintf(os.Stderr, "usage: %s\n\n", c.UsageLine) func validPath(info string) (string, string) {
fmt.Fprintf(os.Stderr, "%s\n", strings.TrimSpace(c.Long)) infos := strings.Split(info, ":")
os.Exit(2)
l := len(infos)
switch {
case l == 1:
return doc.BRANCH, ""
case l == 2:
switch infos[1] {
case doc.TRUNK, doc.MASTER, doc.DEFAULT:
infos[1] = ""
}
return infos[0], infos[1]
default:
log.Error("", "Cannot parse dependency version:")
log.Error("", "\t"+info)
log.Help("Try 'gopm help get' to get more information")
return "", ""
}
} }
// Runnable reports whether the command can be run; otherwise func versionSuffix(value string) string {
// it is a documentation pseudo-command such as importpath. if len(value) > 0 {
func (c *Command) Runnable() bool { return "." + value
return c.Run != nil }
return ""
} }

17
cmd/gen.go

@ -41,8 +41,7 @@ Make sure you run this command in the root path of a go project.`,
// scan a directory and gen a gopm file // scan a directory and gen a gopm file
func runGen(ctx *cli.Context) { func runGen(ctx *cli.Context) {
log.PureMode = ctx.GlobalBool("noterm") setup(ctx)
log.Verbose = ctx.GlobalBool("verbose")
if !com.IsExist(".gopmfile") { if !com.IsExist(".gopmfile") {
os.Create(".gopmfile") os.Create(".gopmfile")
@ -54,19 +53,9 @@ func runGen(ctx *cli.Context) {
log.Fatal("", "\t"+err.Error()) log.Fatal("", "\t"+err.Error())
} }
curPath, err := os.Getwd()
if err != nil {
log.Error("gen", "Cannot get work directory:")
log.Fatal("", "\t"+err.Error())
}
// Get dependencies. // Get dependencies.
importPath, err := gf.GetValue("target", "path") imports := doc.GetAllImports([]string{workDir},
if err != nil { parseTarget(gf.MustValue("target", "path")), ctx.Bool("example"))
importPath = "."
}
imports := doc.GetAllImports([]string{curPath},
importPath, ctx.Bool("example"))
for _, p := range imports { for _, p := range imports {
if _, err := gf.GetValue("deps", doc.GetProjectPath(p)); err != nil { if _, err := gf.GetValue("deps", doc.GetProjectPath(p)); err != nil {

136
cmd/get.go

@ -15,11 +15,9 @@
package cmd package cmd
import ( import (
"errors"
"fmt" "fmt"
"os" "os"
"path" "path"
"path/filepath"
"strings" "strings"
"github.com/Unknwon/com" "github.com/Unknwon/com"
@ -33,6 +31,8 @@ import (
var ( var (
installRepoPath string // The path of gopm local repository. installRepoPath string // The path of gopm local repository.
installGopath string // The first path in the GOPATH. installGopath string // The first path in the GOPATH.
isHasGopath bool // Indicates whether system has GOPATH.
downloadCache map[string]bool // Saves packages that have been downloaded. downloadCache map[string]bool // Saves packages that have been downloaded.
downloadCount int downloadCount int
failConut int failConut int
@ -50,16 +50,16 @@ gopm get <package name>@[<tag|commit|branch>:<value>]
Can specify one or more: gopm get beego@tag:v0.9.0 github.com/beego/bee Can specify one or more: gopm get beego@tag:v0.9.0 github.com/beego/bee
If no argument is supplied, then gopmfile must be present.
If no version specified and package exists in GOPATH, If no version specified and package exists in GOPATH,
it will be skipped unless user enabled '--remote, -r' option it will be skipped unless user enabled '--remote, -r' option
then all the packages go into gopm local repository.`, then all the packages go into gopm local repository.`,
Action: runGet, Action: runGet,
Flags: []cli.Flag{ Flags: []cli.Flag{
cli.BoolFlag{"gopath, g", "download all pakcages to GOPATH"}, cli.BoolFlag{"gopath, g", "download all pakcages to GOPATH"},
cli.BoolFlag{"force, f", "force to update pakcage(s) and dependencies"}, cli.BoolFlag{"update, u", "update pakcage(s) and dependencies if any"},
cli.BoolFlag{"example, e", "download dependencies for example folder"}, cli.BoolFlag{"example, e", "download dependencies for example folder"},
cli.BoolFlag{"remote, r", "download all pakcages to gopm local repository"}, cli.BoolFlag{"remote, r", "download all pakcages to gopm local repository"},
cli.BoolFlag{"verbose, v", "show process details"},
}, },
} }
@ -68,8 +68,7 @@ func init() {
} }
func runGet(ctx *cli.Context) { func runGet(ctx *cli.Context) {
log.PureMode = ctx.GlobalBool("noterm") setup(ctx)
log.Verbose = ctx.GlobalBool("verbose")
// Check conflicts. // Check conflicts.
if ctx.Bool("gopath") && ctx.Bool("remote") { if ctx.Bool("gopath") && ctx.Bool("remote") {
@ -82,85 +81,62 @@ func runGet(ctx *cli.Context) {
if !ctx.Bool("remote") { if !ctx.Bool("remote") {
// Get GOPATH. // Get GOPATH.
installGopath = com.GetGOPATHs()[0] installGopath = com.GetGOPATHs()[0]
if !com.IsDir(installGopath) { if com.IsDir(installGopath) {
isHasGopath = true
log.Log("Indicated GOPATH: %s", installGopath)
installGopath += "/src"
} else {
if ctx.Bool("gopath") {
log.Error("get", "Invalid GOPATH path") log.Error("get", "Invalid GOPATH path")
log.Error("", "GOPATH does not exist or is not a directory:") log.Error("", "GOPATH does not exist or is not a directory:")
log.Error("", "\t"+installGopath) log.Error("", "\t"+installGopath)
log.Help("Try 'go help gopath' to get more information") log.Help("Try 'go help gopath' to get more information")
} else {
// It's OK that no GOPATH setting
// when user does not specify to use.
log.Warn("No GOPATH setting available")
}
} }
log.Log("Indicated GOPATH: %s", installGopath)
installGopath += "/src"
} }
// The gopm local repository. // The gopm local repository.
installRepoPath = doc.HomeDir + "/repos" installRepoPath = doc.HomeDir + "/repos"
log.Log("Local repository path: %s", installRepoPath) log.Log("Local repository path: %s", installRepoPath)
// Check number of arguments. // Check number of arguments to decide which function to call.
switch len(ctx.Args()) { switch len(ctx.Args()) {
case 0: case 0:
getByGopmfile(ctx) getByGopmfile(ctx)
default: default:
getByPath(ctx) getByPath(ctx)
} }
} }
func getByGopmfile(ctx *cli.Context) { func getByGopmfile(ctx *cli.Context) {
// Check if gopmfile exists and generate one if not.
if !com.IsFile(".gopmfile") { if !com.IsFile(".gopmfile") {
log.Error("get", "Gopmfile not found") runGen(ctx)
log.Error("", "No argument is supplied and no gopmfile exists")
log.Help("\n%s\n%s\n%s",
"Work directory is supposed to have gopmfile when there is no argument supplied",
"Try 'gopm gen' to auto-generate gopmfile",
"Try 'gopm help gen' to get more information")
} }
gf := doc.NewGopmfile(".") gf := doc.NewGopmfile(".")
absPath, err := filepath.Abs(".")
if err != nil {
log.Error("get", "Fail to get absolute path of work directory")
log.Fatal("", "\t"+err.Error())
}
log.Log("Work directory: %s", absPath)
// Get dependencies. // Get dependencies.
imports := doc.GetAllImports([]string{absPath}, imports := doc.GetAllImports([]string{workDir},
gf.MustValue("target", "path"), ctx.Bool("example")) parseTarget(gf.MustValue("target", "path")), ctx.Bool("example"))
nodes := make([]*doc.Node, 0, len(imports)) nodes := make([]*doc.Node, 0, len(imports))
for _, p := range imports { for _, p := range imports {
node := doc.NewNode(p, p, doc.BRANCH, "", true) node := doc.NewNode(p, p, doc.BRANCH, "", true)
// Check if user specified the version. // Check if user specified the version.
if v, err := gf.GetValue("deps", p); err == nil && len(v) > 0 { if v, err := gf.GetValue("deps", p); err == nil && len(v) > 0 {
tp, ver, err := validPath(v) node.Type, node.Value = validPath(v)
if err != nil {
log.Error("get", "Cannot parse dependency version")
log.Error("", err.Error()+":")
log.Error("", "\t"+v)
log.Help("Try 'gopm help get' to get more information")
}
node.Type = tp
node.Value = ver
} }
nodes = append(nodes, node) nodes = append(nodes, node)
} }
downloadPackages(ctx, nodes) downloadPackages(ctx, nodes)
doc.SaveLocalNodes()
if doc.LocalNodes != nil { log.Log("%d package(s) downloaded, %d failed", downloadCount, failConut)
if err := goconfig.SaveConfigFile(doc.LocalNodes,
doc.HomeDir+doc.LocalNodesFile); err != nil {
log.Error("get", "Fail to save localnodes.list:")
log.Error("", "\t"+err.Error())
}
}
log.Log("%d package(s) downloaded, %d failed",
downloadCount, failConut)
} }
func getByPath(ctx *cli.Context) { func getByPath(ctx *cli.Context) {
@ -171,13 +147,7 @@ func getByPath(ctx *cli.Context) {
if i := strings.Index(info, "@"); i > -1 { if i := strings.Index(info, "@"); i > -1 {
pkgPath = info[:i] pkgPath = info[:i]
tp, ver, err := validPath(info[i+1:]) tp, ver := validPath(info[i+1:])
if err != nil {
log.Error("get", "Cannot parse dependency version")
log.Error("", err.Error()+":")
log.Error("", "\t"+info[i+1:])
log.Help("Try 'gopm help get' to get more information")
}
node = doc.NewNode(pkgPath, pkgPath, tp, ver, true) node = doc.NewNode(pkgPath, pkgPath, tp, ver, true)
} }
@ -190,17 +160,9 @@ func getByPath(ctx *cli.Context) {
} }
downloadPackages(ctx, nodes) downloadPackages(ctx, nodes)
doc.SaveLocalNodes()
if doc.LocalNodes != nil { log.Log("%d package(s) downloaded, %d failed", downloadCount, failConut)
if err := goconfig.SaveConfigFile(doc.LocalNodes,
doc.HomeDir+doc.LocalNodesFile); err != nil {
log.Error("get", "Fail to save localnodes.list:")
log.Error("", "\t"+err.Error())
}
}
log.Log("%d package(s) downloaded, %d failed",
downloadCount, failConut)
} }
func copyToGopath(srcPath, destPath string) { func copyToGopath(srcPath, destPath string) {
@ -234,6 +196,7 @@ func downloadPackages(ctx *cli.Context, nodes []*doc.Node) {
if ctx.Bool("gopath") { if ctx.Bool("gopath") {
copyToGopath(installPath, gopathDir) copyToGopath(installPath, gopathDir)
log.Log("Package copied to GOPATH: %s", n.ImportPath)
} }
continue continue
} else { } else {
@ -241,7 +204,7 @@ func downloadPackages(ctx *cli.Context, nodes []*doc.Node) {
} }
} }
if !downloadCache[n.ImportPath] { if !downloadCache[n.RootPath] {
// Download package. // Download package.
nod, imports := downloadPackage(ctx, n) nod, imports := downloadPackage(ctx, n)
if len(imports) > 0 { if len(imports) > 0 {
@ -249,7 +212,7 @@ func downloadPackages(ctx *cli.Context, nodes []*doc.Node) {
// Check if has gopmfile // Check if has gopmfile
if com.IsFile(installPath + "/" + doc.GOPM_FILE_NAME) { if com.IsFile(installPath + "/" + doc.GOPM_FILE_NAME) {
log.Log("Found gopmgile: %s@%s:%s", log.Log("Found gopmfile: %s@%s:%s",
n.ImportPath, n.Type, doc.CheckNodeValue(n.Value)) n.ImportPath, n.Type, doc.CheckNodeValue(n.Value))
gf = doc.NewGopmfile(installPath) gf = doc.NewGopmfile(installPath)
@ -268,15 +231,7 @@ func downloadPackages(ctx *cli.Context, nodes []*doc.Node) {
// Check if user specified the version. // Check if user specified the version.
if v, err := gf.GetValue("deps", imports[i]); err == nil && if v, err := gf.GetValue("deps", imports[i]); err == nil &&
len(v) > 0 { len(v) > 0 {
tp, ver, err := validPath(v) nodes[i].Type, nodes[i].Value = validPath(v)
if err != nil {
log.Error("download", "Cannot parse dependency version")
log.Error("", err.Error()+":")
log.Error("", "\t"+v)
log.Help("Try 'gopm help get' to get more information")
}
nodes[i].Type = tp
nodes[i].Value = ver
} }
} }
downloadPackages(ctx, nodes) downloadPackages(ctx, nodes)
@ -296,6 +251,7 @@ func downloadPackages(ctx *cli.Context, nodes []*doc.Node) {
if ctx.Bool("gopath") { if ctx.Bool("gopath") {
copyToGopath(installPath, gopathDir) copyToGopath(installPath, gopathDir)
log.Log("Package copied to GOPATH: %s", n.ImportPath)
} }
} }
} else { } else {
@ -318,7 +274,7 @@ func downloadPackage(ctx *cli.Context, nod *doc.Node) (*doc.Node, []string) {
log.Message("Downloading", fmt.Sprintf("package: %s@%s:%s", log.Message("Downloading", fmt.Sprintf("package: %s@%s:%s",
nod.ImportPath, nod.Type, doc.CheckNodeValue(nod.Value))) nod.ImportPath, nod.Type, doc.CheckNodeValue(nod.Value)))
// Mark as donwloaded. // Mark as donwloaded.
downloadCache[nod.ImportPath] = true downloadCache[nod.RootPath] = true
nod.Revision = doc.LocalNodes.MustValue(nod.RootPath, "value") nod.Revision = doc.LocalNodes.MustValue(nod.RootPath, "value")
imports, err := doc.PureDownload(nod, installRepoPath, ctx) //CmdGet.Flags) imports, err := doc.PureDownload(nod, installRepoPath, ctx) //CmdGet.Flags)
@ -332,29 +288,3 @@ func downloadPackage(ctx *cli.Context, nod *doc.Node) (*doc.Node, []string) {
} }
return nod, imports return nod, imports
} }
// validPath checks if the information of the package is valid.
func validPath(info string) (string, string, error) {
infos := strings.Split(info, ":")
l := len(infos)
switch {
case l == 1:
return doc.BRANCH, "", nil
case l == 2:
switch infos[1] {
case doc.TRUNK, doc.MASTER, doc.DEFAULT:
infos[1] = ""
}
return infos[0], infos[1], nil
default:
return "", "", errors.New("Invalid version information")
}
}
func versionSuffix(value string) string {
if len(value) > 0 {
return "." + value
}
return ""
}

1
cmd/install.go

@ -36,7 +36,6 @@ gopm install <import path>
If no argument is supplied, then gopmfile must be present`, If no argument is supplied, then gopmfile must be present`,
Action: runInstall, Action: runInstall,
Flags: []cli.Flag{ Flags: []cli.Flag{
cli.BoolFlag{"verbose, v", "show process details"},
cli.BoolFlag{"pkg, p", "only install non-main packages"}, cli.BoolFlag{"pkg, p", "only install non-main packages"},
}, },
} }

190
cmd/search.go

@ -14,99 +14,99 @@
package cmd package cmd
import ( // import (
"encoding/json" // "encoding/json"
"fmt" // "fmt"
"io/ioutil" // "io/ioutil"
"net/http" // "net/http"
"github.com/Unknwon/com" // "github.com/Unknwon/com"
) // )
var CmdSearch = &Command{ // var CmdSearch = &Command{
UsageLine: "search [keyword]", // UsageLine: "search [keyword]",
Short: "search for package", // Short: "search for package",
Long: ` // Long: `
search packages
The search flags are:
-e
search extactly, you should input an exactly package name as keyword
`,
}
func init() {
CmdSearch.Run = runSearch
CmdSearch.Flags = map[string]bool{
"-e": false,
}
}
func printSearchPrompt(flag string) {
switch flag {
case "-e":
com.ColorLog("[INFO] You enabled exactly search.\n")
}
}
// search packages // search packages
func runSearch(cmd *Command, args []string) {
// The search flags are:
// Check length of arguments.
if len(args) < 1 { // -e
com.ColorLog("[ERROR] Please input package's keyword.\n") // search extactly, you should input an exactly package name as keyword
return // `,
} // }
var host, port string // func init() {
host = "localhost" // CmdSearch.Run = runSearch
port = "8991" // CmdSearch.Flags = map[string]bool{
// "-e": false,
if cmd.Flags["-e"] { // }
search(host, port, args[0], true) // }
} else {
search(host, port, args[0], false) // func printSearchPrompt(flag string) {
} // switch flag {
} // case "-e":
// com.ColorLog("[INFO] You enabled exactly search.\n")
type searchRes struct { // }
Pkg string // }
Desc string
} // // search packages
// func runSearch(cmd *Command, args []string) {
/*
request local or remote search service to find packages according to keyword inputed // // Check length of arguments.
*/ // if len(args) < 1 {
func search(host, port, keyword string, isExactly bool) { // com.ColorLog("[ERROR] Please input package's keyword.\n")
url := fmt.Sprintf("http://%v:%v/search?%v", host, port, keyword) // return
if isExactly { // }
url = fmt.Sprintf("http://%v:%v/searche?%v", host, port, keyword)
} // var host, port string
resp, err := http.Get(url) // host = "localhost"
if err != nil { // port = "8991"
com.ColorLog(err.Error())
return // if cmd.Flags["-e"] {
} // search(host, port, args[0], true)
defer resp.Body.Close() // } else {
// search(host, port, args[0], false)
if resp.StatusCode == 200 { // }
contents, err := ioutil.ReadAll(resp.Body) // }
if err != nil {
com.ColorLog(err.Error()) // type searchRes struct {
return // Pkg string
} // Desc string
// }
pkgs := make([]searchRes, 0)
err = json.Unmarshal(contents, &pkgs) // /*
if err != nil { // request local or remote search service to find packages according to keyword inputed
com.ColorLog(err.Error()) // */
return // func search(host, port, keyword string, isExactly bool) {
} // url := fmt.Sprintf("http://%v:%v/search?%v", host, port, keyword)
for i, pkg := range pkgs { // if isExactly {
fmt.Println(i+1, pkg.Pkg, "\t", pkg.Desc) // url = fmt.Sprintf("http://%v:%v/searche?%v", host, port, keyword)
} // }
} else { // resp, err := http.Get(url)
com.ColorLog(resp.Status) // if err != nil {
} // com.ColorLog(err.Error())
} // return
// }
// defer resp.Body.Close()
// if resp.StatusCode == 200 {
// contents, err := ioutil.ReadAll(resp.Body)
// if err != nil {
// com.ColorLog(err.Error())
// return
// }
// pkgs := make([]searchRes, 0)
// err = json.Unmarshal(contents, &pkgs)
// if err != nil {
// com.ColorLog(err.Error())
// return
// }
// for i, pkg := range pkgs {
// fmt.Println(i+1, pkg.Pkg, "\t", pkg.Desc)
// }
// } else {
// com.ColorLog(resp.Status)
// }
// }

6
cmd/update.go

@ -69,11 +69,7 @@ func runUpdate(ctx *cli.Context) {
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]
_, ver, err = validPath(info[i+1:]) _, ver = validPath(info[i+1:])
if err != nil {
log.Error("Update", "Fail to parse version")
log.Fatal("", err.Error())
}
} }
// Check package name. // Check package name.

14
doc/conf.go

@ -93,7 +93,7 @@ func GetPkgFullPath(short string) string {
name, ok := PackageNameList[short] name, ok := PackageNameList[short]
if !ok { if !ok {
log.Error("", "Invalid package name") log.Error("", "Invalid package name")
log.Error("", "No match in the package name list:") log.Error("", "It's not a invalid import path and no match in the package name list:")
log.Fatal("", "\t"+short) log.Fatal("", "\t"+short)
} }
return name return name
@ -109,9 +109,17 @@ func LoadLocalNodes() {
} }
var err error var err error
LocalNodes, err = goconfig.LoadConfigFile(HomeDir + LocalNodesFile) LocalNodes, err = goconfig.LoadConfigFile(path.Join(HomeDir + LocalNodesFile))
if err != nil { if err != nil {
log.Error("Load node", "Fail to load localnodes.list") log.Error("load node", "Fail to load localnodes.list")
log.Fatal("", err.Error()) log.Fatal("", err.Error())
} }
} }
func SaveLocalNodes() {
if err := goconfig.SaveConfigFile(LocalNodes,
path.Join(HomeDir+LocalNodesFile)); err != nil {
log.Error("", "Fail to save localnodes.list:")
log.Error("", "\t"+err.Error())
}
}

3
doc/vcs.go

@ -26,6 +26,7 @@ import (
"github.com/Unknwon/com" "github.com/Unknwon/com"
"github.com/codegangsta/cli" "github.com/codegangsta/cli"
"github.com/gpmgo/gopm/log"
) )
var ( var (
@ -119,7 +120,7 @@ func PureDownload(nod *Node, installRepoPath string, ctx *cli.Context) ([]string
return s.get(HttpClient, match, installRepoPath, nod, ctx) return s.get(HttpClient, match, installRepoPath, nod, ctx)
} }
com.ColorLog("[TRAC] Cannot match any service, getting dynamic...\n") log.Log("Cannot match any service, getting dynamic...")
return getDynamic(HttpClient, nod, installRepoPath, ctx) return getDynamic(HttpClient, nod, installRepoPath, ctx)
} }

3
gopm.go

@ -29,7 +29,7 @@ import (
// Test that go1.1 tag above is included in builds. main.go refers to this definition. // Test that go1.1 tag above is included in builds. main.go refers to this definition.
const go11tag = true const go11tag = true
const APP_VER = "0.5.7.1205" const APP_VER = "0.6.0.1206"
// //cmd.CmdSearch, // //cmd.CmdSearch,
// cmdClean, // cmdClean,
@ -63,7 +63,6 @@ func main() {
} }
app.Flags = append(app.Flags, []cli.Flag{ app.Flags = append(app.Flags, []cli.Flag{
cli.BoolFlag{"noterm", "disable color output"}, cli.BoolFlag{"noterm", "disable color output"},
cli.BoolFlag{"verbose", "show process details"},
}...) }...)
app.Run(os.Args) app.Run(os.Args)
} }

Loading…
Cancel
Save