MCPcopy Create free account
hub / github.com/HashLoad/boss / Run

Function Run

core/scripts/runner.go:48–64  ·  view source on GitHub ↗
(args []string)

Source from the content-addressed store, hash-verified

46}
47
48func Run(args []string) {
49 if pkgJson, e := models.LoadPackage(true); e != nil {
50 msg.Err(e.Error())
51 } else {
52 if pkgJson.Scripts == nil {
53 msg.Die(errors.New("script not exists").Error())
54 }
55 scripts := pkgJson.Scripts.(map[string]interface{})
56
57 if command, ok := scripts[args[0]]; !ok {
58 msg.Err(errors.New("script not exists").Error())
59 } else {
60 RunCmd(command.(string) + " " + strings.Join(args[1:], " "))
61 }
62 }
63
64}

Callers 1

run.goFile · 0.92

Calls 5

LoadPackageFunction · 0.92
ErrFunction · 0.92
DieFunction · 0.92
RunCmdFunction · 0.85
NewMethod · 0.80

Tested by

no test coverage detected