Skip to content

Commit

Permalink
bump for 1.0.8 and fix sample-dcrd.conf handling (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
jolan authored Aug 25, 2017
1 parent 80bea2f commit 15d1f60
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
19 changes: 18 additions & 1 deletion cmd/dcrinstall/dcrinstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"time"

"github.com/decred/dcrd/chaincfg"
"github.com/decred/dcrd/sampleconfig"
"github.com/decred/dcrutil"
"github.com/decred/dcrwallet/loader"
"github.com/decred/dcrwallet/prompt"
Expand All @@ -43,6 +44,7 @@ type binary struct {
Name string // binary filename
Config string // actual config file
Example string // example config file
ExampleGenerate bool // whether or not to generate the example config
SupportsVersion bool // whether or not it supports --version
}

Expand All @@ -56,6 +58,9 @@ var (
},
{
Name: "dcrd",
Config: "dcrd.conf",
Example: "sample-dcrd.conf",
ExampleGenerate: true,
SupportsVersion: true,
},
{
Expand Down Expand Up @@ -422,11 +427,23 @@ func (c *ctx) createConfigNormal(b binary, f *os.File) (string, error) {
}

func (c *ctx) createConfig(b binary, version string) (string, error) {
// read sample config
sample := filepath.Join(c.s.Destination,
"decred-"+c.s.Tuple+"-"+version,
b.Example)

// write sample config if needed
if b.ExampleGenerate {
switch b.Name {
case "dcrd":
err := ioutil.WriteFile(sample, []byte(sampleconfig.FileContents), 0644)
if err != nil {
return "", fmt.Errorf("unable to write sample config to %v: %v",
sample, err)
}
}
}

// read sample config
f, err := os.Open(sample)
if err != nil {
return "", err
Expand Down
4 changes: 2 additions & 2 deletions cmd/dcrinstall/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (

// latestVersion and latestManifest must be updated every release.
const (
latestManifest = "manifest-v1.0.7.txt"
defaultURI = "https://github.com/decred/decred-binaries/releases/download/v1.0.7"
latestManifest = "manifest-v1.0.8.txt"
defaultURI = "https://github.com/decred/decred-binaries/releases/download/v1.0.8"

netMain = "mainnet"
netTest = "testnet"
Expand Down
2 changes: 1 addition & 1 deletion cmd/dcrinstall/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const semanticAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr
const (
appMajor uint = 1
appMinor uint = 0
appPatch uint = 7
appPatch uint = 8

// appPreRelease MUST only contain characters from semanticAlphabet
// per the semantic versioning spec.
Expand Down
13 changes: 7 additions & 6 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import:
version: v1.0.7
subpackages:
- chaincfg
- sampleconfig
- package: github.com/decred/dcrutil
- package: github.com/decred/dcrwallet
version: v1.0.7
Expand Down

0 comments on commit 15d1f60

Please sign in to comment.