mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-14 07:26:47 +00:00
* Bump CI versions * Specifically set go version as 1.17.x bumps it to 1.18 * Another * Adjust AppVeyor * Part 1 of linter issues * Part 2 * Fix various linters and improvements * Part 3 * Finishing touches * Tests and EqualFold * Fix nitterinos plus bonus requester jobs bump for exchanges with large number of tests * Fix nitterinos and bump golangci-lint timeout for AppVeyor * Address nits, ensure all books are returned on err due to syncer regression * Fix the wiggins * Fix duplication * Fix nitterinos
67 lines
1.2 KiB
Go
67 lines
1.2 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"os"
|
|
|
|
"github.com/thrasher-corp/gocryptotrader/config"
|
|
"github.com/thrasher-corp/gocryptotrader/core"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
var (
|
|
app = &cli.App{
|
|
Name: "dbseed",
|
|
Version: core.Version(false),
|
|
EnableBashCompletion: true,
|
|
Flags: []cli.Flag{
|
|
&cli.StringFlag{
|
|
Name: "config",
|
|
Value: config.DefaultFilePath(),
|
|
Usage: "config file to load",
|
|
Destination: &configFile,
|
|
},
|
|
&cli.BoolFlag{
|
|
Name: "verbose",
|
|
Usage: "toggle verbose output",
|
|
Destination: &verbose,
|
|
},
|
|
},
|
|
Commands: []*cli.Command{
|
|
seedExchangeCommand,
|
|
seedCandleCommand,
|
|
},
|
|
}
|
|
workingDir string
|
|
configFile string
|
|
verbose bool
|
|
)
|
|
|
|
func main() {
|
|
var err error
|
|
workingDir, err = os.Getwd()
|
|
if err != nil {
|
|
log.Println("error getting current working path")
|
|
workingDir = "."
|
|
}
|
|
|
|
fmt.Println("GoCryptoTrader database seeding tool")
|
|
fmt.Println(core.Copyright)
|
|
fmt.Println()
|
|
|
|
err = app.Run(os.Args)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
if dbConn != nil {
|
|
if dbConn.SQL != nil {
|
|
err = dbConn.SQL.Close()
|
|
if err != nil {
|
|
log.Println(err)
|
|
}
|
|
}
|
|
}
|
|
}
|