Browse Source

Added stderr output

pull/103/head
Unknown 11 years ago
parent
commit
cc8d3377de
  1. 15
      cmd/bin.go
  2. 2
      gopm.go

15
cmd/bin.go

@ -93,14 +93,17 @@ func runBin(ctx *cli.Context) {
} }
// Get code. // Get code.
stdout, _, _ := com.ExecCmd("gopm", "get", "-r", ctx.Args()[0]) stdout, stderr, _ := com.ExecCmd("gopm", "get", "-r", ctx.Args()[0])
if len(stdout) > 0 { if len(stdout) > 0 {
fmt.Print(stdout) fmt.Print(stdout)
} }
if len(stderr) > 0 {
log.Error("bin", "Fail to 'gopm get -r':")
log.Fatal("", "\r"+stderr)
}
// Check if previous steps were successful. // Check if previous steps were successful.
repoPath := strings.Replace(installRepoPath+"/"+pkgPath+versionSuffix(ver), repoPath := installRepoPath + "/" + pkgPath + versionSuffix(ver)
"\\", "/", -1)
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")
@ -121,10 +124,14 @@ func runBin(ctx *cli.Context) {
} }
// Build application. // Build application.
stdout, _, _ = com.ExecCmd("gopm", "build") stdout, stderr, _ = com.ExecCmd("gopm", "build")
if len(stdout) > 0 { if len(stdout) > 0 {
fmt.Print(stdout) fmt.Print(stdout)
} }
if len(stderr) > 0 {
log.Error("bin", "Fail to 'gopm build':")
log.Fatal("", "\r"+stderr)
}
defer func() { defer func() {
// Clean files. // Clean files.
//os.RemoveAll(path.Join(repoPath, doc.VENDOR)) //os.RemoveAll(path.Join(repoPath, doc.VENDOR))

2
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.2" const APP_VER = "0.5.7.1205.3"
// //cmd.CmdSearch, // //cmd.CmdSearch,
// cmdClean, // cmdClean,

Loading…
Cancel
Save