config: export sampleconfig for use by dcrinstall

This commit is contained in:
jolan 2017-08-25 10:32:26 -05:00
parent aa2b50714e
commit d18bca456e
2 changed files with 5 additions and 3 deletions

View File

@ -27,6 +27,7 @@ import (
"github.com/decred/dcrd/database"
_ "github.com/decred/dcrd/database/ffldb"
"github.com/decred/dcrd/mempool"
"github.com/decred/dcrd/sampleconfig"
"github.com/decred/dcrutil"
)
@ -353,7 +354,7 @@ func createDefaultConfigFile(destPath string) error {
// file contents with their generated values.
rpcUserRE := regexp.MustCompile(`(?m)^;\s*rpcuser=[^\s]*$`)
rpcPassRE := regexp.MustCompile(`(?m)^;\s*rpcpass=[^\s]*$`)
s := rpcUserRE.ReplaceAllString(sampleConfigFileContents, rpcUserLine)
s := rpcUserRE.ReplaceAllString(sampleconfig.FileContents, rpcUserLine)
s = rpcPassRE.ReplaceAllString(s, rpcPassLine)
// Create config file at the provided path.

View File

@ -2,9 +2,10 @@
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package main
package sampleconfig
var sampleConfigFileContents = `[Application Options]
// FileContents is a string containing the commented example config for dcrd.
var FileContents = `[Application Options]
; ------------------------------------------------------------------------------
; Data settings