Skip to content

Commit

Permalink
Merge branch 'main' into custom-url-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
adelinag08 authored Mar 5, 2024
2 parents 46d3575 + d9a7d2a commit 6b60fa2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Build
run: |
version=$(git describe --tags --abbrev=7)
go build -ldflags="-X 'github.com/SneaksAndData/snd-cli-go/blob/main/cmd/snd-cli/snd_cli_go.version=$version'" -o snd-${{ matrix.os }}-${{ matrix.arch }} ./cmd/snd-cli
go build -ldflags="-X 'snd-cli/cmd.Version=$version'" -o snd-${{ matrix.os }}-${{ matrix.arch }} ./cmd/snd-cli
- name: Import Secrets
uses: hashicorp/[email protected]
with:
Expand Down
7 changes: 4 additions & 3 deletions cmd/snd-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ package main
import (
"fmt"
"os"
snd_cli_go "snd-cli"
"snd-cli/cmd"
"snd-cli/pkg/cmd/root"
)

func main() {
rootCmd, _ := root.NewCmdRoot()
rootCmd.Version = snd_cli_go.Version
rootCmd.SetVersionTemplate(fmt.Sprintf("snd-cli version %s", snd_cli_go.Version))
rootCmd.Version = cmd.Version
versionTemplate := fmt.Sprintf("snd-cli version %s \n", cmd.Version)
rootCmd.SetVersionTemplate(versionTemplate)
err := rootCmd.Execute()
if err != nil {
fmt.Println("Error: ", err)
Expand Down
2 changes: 1 addition & 1 deletion version.go → cmd/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package snd_cli_go
package cmd

var Version = "v0.0.0"
4 changes: 2 additions & 2 deletions pkg/cmd/util/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"fmt"
"golang.org/x/mod/semver"
"os/exec"
snd_cli_go "snd-cli"
snd "snd-cli/cmd"
"strings"
)

const repoURL = "https://github.com/SneaksAndData/snd-cli-go"

var currentVersion = snd_cli_go.Version
var currentVersion = snd.Version

func CheckIfNewVersionIsAvailable() error {
lastTag, err := getLatestTag(repoURL)
Expand Down

0 comments on commit 6b60fa2

Please sign in to comment.