Browse Source

tools: use os home dir to instead of the hardcoded PATH (#6498)

pull/6524/head
JayT106 4 years ago
committed by GitHub
parent
commit
b4307ca7f4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions
  1. +3
    -0
      CHANGELOG_PENDING.md
  2. +1
    -1
      tools/tm-signer-harness/Makefile
  3. +10
    -1
      tools/tm-signer-harness/main.go

+ 3
- 0
CHANGELOG_PENDING.md View File

@ -59,6 +59,9 @@ Friendly reminder: We have a [bug bounty program](https://hackerone.com/tendermi
- [store/state/evidence/light] \#5771 Use an order-preserving varint key encoding (@cmwaters)
- [mempool] \#6396 Remove mempool's write ahead log (WAL), (previously unused by the tendermint code). (@tychoish)
- Tooling
- [tools] \#6498 Set OS home dir to instead of the hardcoded PATH. (@JayT106)
### FEATURES
- [config] Add `--mode` flag and config variable. See [ADR-52](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-052-tendermint-mode.md) @dongsam


+ 1
- 1
tools/tm-signer-harness/Makefile View File

@ -3,7 +3,7 @@
TENDERMINT_VERSION?=latest
BUILD_TAGS?='tendermint'
VERSION := $(shell git describe --always)
BUILD_FLAGS = -ldflags "-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(VERSION)
BUILD_FLAGS = -ldflags "-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(VERSION)"
.DEFAULT_GOAL := build


+ 10
- 1
tools/tm-signer-harness/main.go View File

@ -18,12 +18,13 @@ import (
const (
defaultAcceptRetries = 100
defaultBindAddr = "tcp://127.0.0.1:0"
defaultTMHome = "~/.tendermint"
defaultAcceptDeadline = 1
defaultConnDeadline = 3
defaultExtractKeyOutput = "./signing.key"
)
var defaultTMHome string
var logger = log.NewTMLogger(log.NewSyncWriter(os.Stdout))
// Command line flags
@ -60,6 +61,14 @@ Use "tm-signer-harness help <command>" for more information about that command.`
fmt.Println("")
}
hd, err := os.UserHomeDir()
if err != nil {
fmt.Println("The UserHomeDir is not defined, setting the default TM Home PATH to \"~/.tendermint\"")
defaultTMHome = "~/.tendermint"
} else {
defaultTMHome = fmt.Sprintf("%s/.tendermint", hd)
}
runCmd = flag.NewFlagSet("run", flag.ExitOnError)
runCmd.IntVar(&flagAcceptRetries,
"accept-retries",


Loading…
Cancel
Save