parent
82ea753aa2
commit
1382fc8fe8
12
.travis.yml
12
.travis.yml
@ -3,10 +3,14 @@ go: stable
|
|||||||
|
|
||||||
script:
|
script:
|
||||||
- go run analysis.go ./...
|
- go run analysis.go ./...
|
||||||
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o "mkcert-$(git describe --tags)-linux-amd64"
|
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o "mkcert-$(git describe --tags)-linux-amd64" \
|
||||||
- CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -o "mkcert-$(git describe --tags)-linux-arm"
|
-ldflags "-X main.Version=$(git describe --tags)"
|
||||||
- CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o "mkcert-$(git describe --tags)-darwin-amd64"
|
- CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -o "mkcert-$(git describe --tags)-linux-arm" \
|
||||||
- CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o "mkcert-$(git describe --tags)-windows-amd64.exe"
|
-ldflags "-X main.Version=$(git describe --tags)"
|
||||||
|
- CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o "mkcert-$(git describe --tags)-darwin-amd64" \
|
||||||
|
-ldflags "-X main.Version=$(git describe --tags)"
|
||||||
|
- CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o "mkcert-$(git describe --tags)-windows-amd64.exe" \
|
||||||
|
-ldflags "-X main.Version=$(git describe --tags)"
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
provider: releases
|
provider: releases
|
||||||
|
8
main.go
8
main.go
@ -78,6 +78,9 @@ const advancedUsage = `Advanced options:
|
|||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
|
// Version is set more precisely at build time.
|
||||||
|
var Version = "v1.4.0-dev"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
log.SetFlags(0)
|
log.SetFlags(0)
|
||||||
var (
|
var (
|
||||||
@ -92,6 +95,7 @@ func main() {
|
|||||||
certFileFlag = flag.String("cert-file", "", "")
|
certFileFlag = flag.String("cert-file", "", "")
|
||||||
keyFileFlag = flag.String("key-file", "", "")
|
keyFileFlag = flag.String("key-file", "", "")
|
||||||
p12FileFlag = flag.String("p12-file", "", "")
|
p12FileFlag = flag.String("p12-file", "", "")
|
||||||
|
versionFlag = flag.Bool("version", false, "")
|
||||||
)
|
)
|
||||||
flag.Usage = func() {
|
flag.Usage = func() {
|
||||||
fmt.Fprint(flag.CommandLine.Output(), shortUsage)
|
fmt.Fprint(flag.CommandLine.Output(), shortUsage)
|
||||||
@ -103,6 +107,10 @@ func main() {
|
|||||||
fmt.Fprint(flag.CommandLine.Output(), advancedUsage)
|
fmt.Fprint(flag.CommandLine.Output(), advancedUsage)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if *versionFlag {
|
||||||
|
fmt.Println(Version)
|
||||||
|
return
|
||||||
|
}
|
||||||
if *carootFlag {
|
if *carootFlag {
|
||||||
if *installFlag || *uninstallFlag {
|
if *installFlag || *uninstallFlag {
|
||||||
log.Fatalln("ERROR: you can't set -[un]install and -CAROOT at the same time")
|
log.Fatalln("ERROR: you can't set -[un]install and -CAROOT at the same time")
|
||||||
|
Loading…
Reference in New Issue
Block a user