Skip to content

Commit

Permalink
Merge pull request #44 from RoseSecurity/fix-version-command
Browse files Browse the repository at this point in the history
fix: Fix version command
  • Loading branch information
RoseSecurity authored Aug 26, 2024
2 parents ff93643 + 57a07f6 commit 7d2229f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:
- repo: local
hooks:
- id: gofumpt
name: gofumpt
entry: bash -c 'make fmt'
language: system
types: ["go"]
files: main.go|cmd\/.*|internal\/.*
pass_filenames: false
- repo: local
hooks:
- id: rebuild-docs
name: rebuild-docs
entry: bash -c 'make docs'
language: system
files: cmd\/.*
pass_filenames: false
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/spf13/cobra"
)

var Version = "0.0.1"
var Version string

type options struct {
WorkingDir string `env:"WORKING_DIR" envDefault:"."`
Expand Down
2 changes: 2 additions & 0 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func versionCmd(Version string) *cobra.Command {
return cmd
}

// Fetch latest release for comparison to current version
func latestRelease() (string, error) {
resp, err := http.Get("https://api.github.com/repos/RoseSecurity/terramaid/releases/latest")
if err != nil {
Expand All @@ -57,6 +58,7 @@ func latestRelease() (string, error) {
return release.TagName, nil
}

// Display out of date warning
func updateTerramaid(latestVersion string) {
c1 := color.New(color.FgCyan)

Expand Down

0 comments on commit 7d2229f

Please sign in to comment.