MCPcopy Create free account
hub / github.com/Sifchain/sifnode / shellExec

Method shellExec

tools/sifgen/utils/cli.go:227–241  ·  view source on GitHub ↗
(cmd string, args ...string)

Source from the content-addressed store, hash-verified

225}
226
227func (c CLI) shellExec(cmd string, args ...string) (*string, error) {
228 cm := exec.Command(cmd, args...)
229 var out bytes.Buffer
230 var errOut bytes.Buffer
231 cm.Stdout = &out
232 cm.Stderr = &errOut
233
234 err := cm.Run()
235 if err != nil {
236 return nil, fmt.Errorf("error executing %s %s: %s \n %s", cmd, strings.Join(args, " "), err.Error(), errOut.String())
237 }
238
239 result := out.String()
240 return &result, nil
241}
242
243func (c CLI) shellExecInput(cmd string, inputs [][]byte, args ...string) (*string, error) {
244 cm := exec.Command(cmd, args...)

Callers 14

DaemonPathMethod · 0.95
ResetStateMethod · 0.95
MoveFileMethod · 0.95
NodeIDMethod · 0.95
ValidatorAddressMethod · 0.95
InitChainMethod · 0.95
AddGenesisAccountMethod · 0.95
AddGenesisCLPAdminMethod · 0.95
SetGenesisOracleAdminMethod · 0.95
CollectGenesisTxnsMethod · 0.95

Calls 3

RunMethod · 0.45
ErrorMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected