MCPcopy Create free account
hub / github.com/Xenov-X/csbot / executeMkdir

Method executeMkdir

workflow/executor.go:1200–1212  ·  view source on GitHub ↗

executeMkdir creates a directory

(ctx context.Context, client *csclient.Client, beaconID string, action Action)

Source from the content-addressed store, hash-verified

1198
1199// executeMkdir creates a directory
1200func (e *Executor) executeMkdir(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {
1201 folder, ok := action.Parameters["folder"].(string)
1202 if !ok {
1203 return "", fmt.Errorf("folder parameter required for mkdir")
1204 }
1205
1206 resp, err := client.Mkdir(ctx, beaconID, folder)
1207 if err != nil {
1208 return "", err
1209 }
1210
1211 return e.fireAndForget(resp.TaskID, "mkdir "+folder)
1212}
1213
1214// executeCp copies a file
1215func (e *Executor) executeCp(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {

Callers 1

executeActionMethod · 0.95

Calls 1

fireAndForgetMethod · 0.95

Tested by

no test coverage detected