console: Fix console color printing on windows.

Print colored accessKeyID and secretAccessKey are unreadable on windows
on command prompts and powershell.

Use the console package from minio client.
This commit is contained in:
Harshavardhana
2016-03-04 01:50:59 -08:00
parent 91800cff53
commit 164dfe2ec9
14 changed files with 669 additions and 210 deletions
+4 -3
View File
@@ -24,6 +24,7 @@ import (
"strings"
"github.com/hashicorp/go-version"
"github.com/minio/mc/pkg/console"
)
// isContainerized returns true if we are inside a containerized environment.
@@ -49,17 +50,17 @@ func checkGoVersion() {
// Current version.
curVersion, e := version.NewVersion(runtime.Version()[2:])
if e != nil {
Fatalln("Unable to determine current go version.", e)
console.Fatalln("Unable to determine current go version.", e)
}
// Prepare version constraint.
constraints, e := version.NewConstraint(minGoVersion)
if e != nil {
Fatalln("Unable to check go version.")
console.Fatalln("Unable to check go version.")
}
// Check for minimum version.
if !constraints.Check(curVersion) {
Fatalln(fmt.Sprintf("Please recompile Minio with Golang version %s.", minGoVersion))
console.Fatalln(fmt.Sprintf("Please recompile Minio with Golang version %s.", minGoVersion))
}
}