Browse Source

Bug fixed in XP

pull/103/head
Unknown 11 years ago
parent
commit
44363c8499
  1. 12
      cmd/build.go
  2. 5
      log/log.go
  3. 4
      log/log_windows.go

12
cmd/build.go

@ -64,10 +64,14 @@ func runBuild(ctx *cli.Context) {
if isWindowsXP { if isWindowsXP {
binName := pkgName + ".exe" binName := pkgName + ".exe"
os.Remove(binName) os.Remove(binName)
err = os.Rename(path.Join(doc.VENDOR, "src", pkgName, binName), binName) if com.IsFile(path.Join(doc.VENDOR, "src", pkgName, binName)) {
if err != nil { err = os.Rename(path.Join(doc.VENDOR, "src", pkgName, binName), binName)
log.Error("Build", "Fail to move binary") if err != nil {
log.Fatal("", err.Error()) log.Error("Build", "Fail to move binary")
log.Fatal("", err.Error())
}
} else {
log.Warn("No binary generated")
} }
} }

5
log/log.go

@ -36,6 +36,11 @@ func Fatal(hl, msg string) {
os.Exit(2) os.Exit(2)
} }
func Warn(format string, args ...interface{}) {
fmt.Printf("gopm %s %s\n", brush.Purple("WARN"),
fmt.Sprintf(format, args...))
}
func Log(format string, args ...interface{}) { func Log(format string, args ...interface{}) {
fmt.Printf("gopm %s %s\n", brush.White("INFO"), fmt.Printf("gopm %s %s\n", brush.White("INFO"),
fmt.Sprintf(format, args...)) fmt.Sprintf(format, args...))

4
log/log_windows.go

@ -32,6 +32,10 @@ func Fatal(hl, msg string) {
os.Exit(2) os.Exit(2)
} }
func Warn(format string, args ...interface{}) {
fmt.Printf("gopm WARN %s\n", fmt.Sprintf(format, args...))
}
func Log(format string, args ...interface{}) { func Log(format string, args ...interface{}) {
fmt.Printf("gopm INFO %s\n", fmt.Sprintf(format, args...)) fmt.Printf("gopm INFO %s\n", fmt.Sprintf(format, args...))
} }

Loading…
Cancel
Save