diff --git a/.appveyor.yml b/.appveyor.yml index e982c2ae..b485cb9a 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -24,7 +24,8 @@ environment: PSQL_PASS: Password12! PSQL_DBNAME: gct_dev_ci PSQL_SSLMODE: disable - + PSQL_SKIPSQLCMD: true + PSQL_TESTDBNAME: gct_dev_ci stack: go 1.13.x services: diff --git a/.golangci.yml b/.golangci.yml index 6a4ea62b..745d239f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,5 @@ run: - timeout: 1m0s + timeout: 1m30s issues-exit-code: 1 tests: true skip-dirs: diff --git a/.travis.yml b/.travis.yml index f41e6b4c..44aa32b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,8 @@ matrix: - PSQL_USER=postgres - PSQL_HOST=localhost - PSQL_DBNAME=gct_dev_ci + - PSQL_SKIPSQLCMD=true + - PSQL_TESTDBNAME=gct_dev_ci install: true cache: directories: @@ -48,6 +50,8 @@ matrix: - PSQL_USER=postgres - PSQL_HOST=localhost - PSQL_DBNAME=gct_dev_ci + - PSQL_SKIPSQLCMD=true + - PSQL_TESTDBNAME=gct_dev_ci install: true cache: directories: diff --git a/README.md b/README.md index e0ae651d..6852c71f 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ We are aiming to support the top 20 highest volume exchanges based off the [Coin + Packages for handling currency pairs, tickers and orderbooks. + Portfolio management tool; fetches balances from supported exchanges and allows for custom address tracking. + Basic event trigger system. ++ Scripting support. See [gctscript](/gctscript/README.md) + WebGUI (discontinued). ## Planned Features diff --git a/cmd/gctcli/commands.go b/cmd/gctcli/commands.go index 1b596368..fe2bb7c6 100644 --- a/cmd/gctcli/commands.go +++ b/cmd/gctcli/commands.go @@ -4,8 +4,10 @@ import ( "context" "errors" "fmt" + "io/ioutil" "os" "os/exec" + "path/filepath" "runtime" "strconv" "strings" @@ -2915,3 +2917,436 @@ func getAuditEvent(c *cli.Context) error { jsonOutput(result) return nil } + +var uuid, filename, path string +var gctScriptCommand = cli.Command{ + Name: "gctscript", + Usage: "execute gctscript command", + ArgsUsage: " ", + Subcommands: []cli.Command{ + { + Name: "execute", + Usage: "execute script filename", + ArgsUsage: " ", + Flags: []cli.Flag{ + cli.StringFlag{ + Name: "filename", + Usage: "", + Destination: &filename, + }, + cli.StringFlag{ + Name: "path", + Usage: "