Add version display and multiarch build

pull/2/head
Jean-Marc MEESSEN 4 years ago
parent 6172f13193
commit b9bb5e8f5e

1
.gitignore vendored

@ -5,6 +5,7 @@
*.so *.so
*.dylib *.dylib
FLEcli FLEcli
executables/*
# Test binary, built with `go test -c` # Test binary, built with `go test -c`
*.test *.test

@ -41,15 +41,7 @@ var rootCmd = &cobra.Command{
Use: "FLEcli", Use: "FLEcli",
Short: "A Command Line \"Fast Log Entry\" (FLE) processor", Short: "A Command Line \"Fast Log Entry\" (FLE) processor",
TraverseChildren: true, TraverseChildren: true,
// Long: `A longer description that spans multiple lines and likely contains Version: VersionString,
// examples and usage of using your application. For example:
// Cobra is a CLI library for Go that empowers applications.
// This application is a tool to generate the needed files
// to quickly create a Cobra application.`,
// Uncomment the following line if your bare application
// has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { },
} }
// Execute adds all child commands to the root command and sets flags appropriately. // Execute adds all child commands to the root command and sets flags appropriately.

@ -0,0 +1,4 @@
package cmd
const VersionString = "v0.0.0 2020-07-11"

@ -0,0 +1,16 @@
#!/bin/bash
set -e
go test ./...
mkdir -p executables/windows
mkdir -p executables/macos
mkdir -p executables/linux
#Update version
GOOS=windows GOARCH=386 go build -o executables/windows/FLEcli.exe
GOOS=darwin GOARCH=amd64 go build -o executables/macos/FLEcli
GOOS=linux GOARCH=amd64 go build -o executables/linux/FLEcli-amd64

@ -14,6 +14,5 @@ require (
github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.7.0 github.com/spf13/viper v1.7.0
golang.org/x/sys v0.0.0-20200523222454-059865788121 // indirect golang.org/x/sys v0.0.0-20200523222454-059865788121 // indirect
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc
gopkg.in/ini.v1 v1.57.0 // indirect gopkg.in/ini.v1 v1.57.0 // indirect
) )

Loading…
Cancel
Save