migrate invoke to config service
This commit is contained in:
1 parent
b0c9d73755
commit
19c02ef270
12 files changed
+187
-101
No files matched your search
+1
-1
@@ -2,8 +2,8 @@ package command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/pkg/errors"
|
||||
"isp-ctl/cfg"
|
||||
"isp-ctl/service"
|
||||
"strings"
|
||||
|
||||
+2
-3
@@ -2,9 +2,8 @@ package command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/codegangsta/cli"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/tidwall/gjson"
|
||||
"isp-ctl/bash"
|
||||
"isp-ctl/flag"
|
||||
@@ -54,7 +53,7 @@ func (g getCommand) action(ctx *cli.Context) {
|
||||
func (g getCommand) checkObject(jsonObject []byte, depth string) {
|
||||
jsonString := gjson.Get(string(jsonObject), depth)
|
||||
if jsonString.Raw == "" {
|
||||
printError(errors.New(fmt.Sprintf("Path '%s' not found\n", depth)))
|
||||
printError(errors.Errorf("Path '%s' not found\n", depth))
|
||||
} else {
|
||||
var data interface{}
|
||||
if err := json.Unmarshal([]byte(jsonString.Raw), &data); err != nil {
|
||||
|
||||
+3
-4
@@ -1,9 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/codegangsta/cli"
|
||||
"github.com/pkg/errors"
|
||||
"html/template"
|
||||
"isp-ctl/bash"
|
||||
"isp-ctl/flag"
|
||||
@@ -45,8 +44,8 @@ func (s schemaCommand) action(ctx *cli.Context) {
|
||||
case flag.OutPrintHtmlValue:
|
||||
s.printHtml(schema)
|
||||
default:
|
||||
printError(errors.New(fmt.Sprintf(
|
||||
"invalid flag value, expected %s or %s", flag.OutPrintJsonValue, flag.OutPrintHtmlValue)))
|
||||
printError(errors.Errorf(
|
||||
"invalid flag value, expected %s or %s", flag.OutPrintJsonValue, flag.OutPrintHtmlValue))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,8 +2,8 @@ package command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"github.com/codegangsta/cli"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/tidwall/sjson"
|
||||
"io/ioutil"
|
||||
"isp-ctl/bash"
|
||||
|
||||
Reference in new issue
Block a user