Browse Source

barak takes an output-file as option

pull/55/head
Jae Kwon 9 years ago
parent
commit
2151f6f5d6
2 changed files with 14 additions and 2 deletions
  1. +11
    -2
      cmd/barak/main.go
  2. +3
    -0
      cmd/debora/README.md

+ 11
- 2
cmd/barak/main.go View File

@ -6,6 +6,7 @@ package main
import (
"errors"
"flag"
"fmt"
"io"
"io/ioutil"
@ -51,9 +52,17 @@ var barak = struct {
func main() {
fmt.Printf("New Barak Process (PID: %d)\n", os.Getpid())
// read options from stdin.
// read flags to change options file.
var optionsBytes []byte
var optionsFile string
var err error
optionsBytes, err := ioutil.ReadAll(os.Stdin)
flag.StringVar(&optionsFile, "options-file", "", "Read options from file instead of stdin")
flag.Parse()
if optionsFile != "" {
optionsBytes, err = ioutil.ReadFile(optionsFile)
} else {
optionsBytes, err = ioutil.ReadAll(os.Stdin)
}
if err != nil {
panic(Fmt("Error reading input: %v", err))
}


+ 3
- 0
cmd/debora/README.md View File

@ -7,4 +7,7 @@
# Build tendermint from source
./build/debora run -- build_tendermint bash -c "cd $GOPATH/src/github.com/tendermint/tendermint; make"
# Build and run tendermint
./build/debora run -- tendermint bash -c "cd \$GOPATH/src/github.com/tendermint/tendermint; make; ./build/tendermint node"
```

Loading…
Cancel
Save