forked from Fundefir-dev/commons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.go
36 lines (29 loc) · 747 Bytes
/
make.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package main
import (
"flag"
"fmt"
"os/exec"
)
type Color string
const (
ColorBlack Color = "\u001b[30m"
ColorRed = "\u001b[31m"
ColorGreen = "\u001b[32m"
ColorYellow = "\u001b[33m"
ColorBlue = "\u001b[34m"
ColorReset = "\u001b[0m"
)
func colorize(color Color, message string) {
fmt.Println(string(color), message, string(ColorReset))
}
func main() {
// useColor := flag.Bool("color", false, "display colorized output")
flag.Parse()
colorize(ColorGreen, "-------------------")
colorize(ColorGreen, "🙌 CircuitBooking")
colorize(ColorGreen, "-------------------")
cmdStr := "docker-compose ps"
out, _ := exec.Command("/bin/sh", "-c", cmdStr).Output()
fmt.Printf("%s", out)
return
}