Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
validate build to ensure building from the build script
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilsaraf committed Aug 13, 2018
1 parent ad03bd9 commit 1bcc4e9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"fmt"
"log"
"os"

"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -43,9 +44,18 @@ var RootCmd = &cobra.Command{
}

func init() {
validateBuild()

RootCmd.AddCommand(tradeCmd)
RootCmd.AddCommand(strategiesCmd)
RootCmd.AddCommand(exchanagesCmd)
RootCmd.AddCommand(terminateCmd)
RootCmd.AddCommand(versionCmd)
}

func validateBuild() {
if version == "" || buildDate == "" || gitHash == "" {
fmt.Println("version information not included, please build using the build script (scripts/build.sh)")
os.Exit(1)
}
}

0 comments on commit 1bcc4e9

Please sign in to comment.