Use config.json by default if config file isn't encrypted

Fixes issue: https://github.com/thrasher-/gocryptotrader/issues/48
Allows for auto syntax highlighing in text editors/IDEs
This commit is contained in:
Adrian Gallagher
2017-11-14 14:15:01 +11:00
parent 4799c73317
commit ce908ee939
18 changed files with 65 additions and 43 deletions

View File

@@ -20,8 +20,9 @@ func main() {
var inFile, outFile, key string
var encrypt bool
var err error
flag.StringVar(&inFile, "infile", "config.dat", "The config input file to process.")
flag.StringVar(&outFile, "outfile", "config.dat.out", "The config output file.")
configFile := config.GetFilePath("")
flag.StringVar(&inFile, "infile", configFile, "The config input file to process.")
flag.StringVar(&outFile, "outfile", configFile+".out", "The config output file.")
flag.BoolVar(&encrypt, "encrypt", true, "Wether to encrypt or decrypt.")
flag.StringVar(&key, "key", "", "The key to use for AES encryption.")
flag.Parse()

View File

@@ -57,7 +57,7 @@ func getOnlineOfflinePortfolio(coins []portfolio.Coin, online bool) {
func main() {
var inFile, key string
flag.StringVar(&inFile, "infile", "config.dat", "The config input file to process.")
flag.StringVar(&inFile, "infile", config.GetFilePath(""), "The config input file to process.")
flag.StringVar(&key, "key", "", "The key to use for AES encryption.")
flag.Parse()