Skip to content

Commit

Permalink
Reverted WaggleVersion() to WAGGLE_VERSION
Browse files Browse the repository at this point in the history
Better for there to be a single source of truth for version inside a go
source file.
  • Loading branch information
zomglings committed Aug 19, 2023
1 parent cb3eb22 commit e5d528a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bugout.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func WriteCursorToJournal(client *bugout.BugoutClient, token, journalID, cursorN
tags := []string{
"type:cursor",
fmt.Sprintf("cursor:%s", cursorName),
fmt.Sprintf("waggle_version:%s", WaggleVersion()),
fmt.Sprintf("waggle_version:%s", WAGGLE_VERSION),
}
content := fmt.Sprintf("Cursor: %s at %s\nQuery: %s", cursorName, cursor, queryTerms)
_, err := client.Spire.CreateEntry(token, journalID, title, content, tags, entryContext)
Expand Down
2 changes: 1 addition & 1 deletion cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func CreateVersionCommand() *cobra.Command {
Short: "Print the version number of waggle",
Long: `All software has versions. This is waggle's`,
Run: func(cmd *cobra.Command, args []string) {
cmd.Println(WaggleVersion())
cmd.Println(WAGGLE_VERSION)
},
}
return versionCmd
Expand Down
15 changes: 1 addition & 14 deletions version.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
package main

import (
"fmt"
"io/ioutil"
"os"
)

func WaggleVersion() string {
version, err := ioutil.ReadFile("version.txt")
if err != nil {
fmt.Println(err.Error())
os.Exit(1)
}
return string(version)
}
var WAGGLE_VERSION = "0.0.9"
1 change: 0 additions & 1 deletion version.txt

This file was deleted.

0 comments on commit e5d528a

Please sign in to comment.