Skip to content

Commit

Permalink
Release v1.9.0
Browse files Browse the repository at this point in the history
- version bump
- remove need for manual version bump,
  ensuring -v in CLI prints the value from version.json
  • Loading branch information
lidel committed Aug 30, 2022
1 parent 20e8745 commit 7fdd2e2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
18 changes: 17 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
package config

import "encoding/json"

// CurrentAppName is the name of this application
const CurrentAppName = "ipfs-update"

// CurrentVersionNumber is the current application's version literal
const CurrentVersionNumber = "1.8.0-dev"
var CurrentVersionNumber string

// CurrentCommit is the current git commit, if it is available.
// It might not be currently available, but it might be later if we
// add a Makefile and set it as a ldflag in the Makefile.
var CurrentCommit string

// ../version.json
type VersionFile struct {
Version string `json:"version"`
}

func SetVersionNumber(versionFile []byte) error {
manifest := VersionFile{}
err := json.Unmarshal(versionFile, &manifest)
if err == nil {
CurrentVersionNumber = manifest.Version
}
return err
}
8 changes: 8 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"bufio"
"context"
_ "embed"
"fmt"
"os"
"os/exec"
Expand All @@ -20,8 +21,15 @@ import (
"github.com/whyrusleeping/stump"
)

//go:embed version.json
var versionFile []byte

func init() {
stump.ErrOut = os.Stderr
err := config.SetVersionNumber(versionFile)
if err != nil {
fmt.Println(err)
}
}

func main() {
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "v1.8.0"
"version": "v1.9.0"
}

0 comments on commit 7fdd2e2

Please sign in to comment.