MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / fileRmRun

Function fileRmRun

cmd/wsh/cmd/wshcmd-file.go:223–239  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

221}
222
223func fileRmRun(cmd *cobra.Command, args []string) error {
224 path, err := fixRelativePaths(args[0])
225 if err != nil {
226 return err
227 }
228 recursive, err := cmd.Flags().GetBool("recursive")
229 if err != nil {
230 return err
231 }
232
233 err = wshclient.FileDeleteCommand(RpcClient, wshrpc.CommandDeleteFileData{Path: path, Recursive: recursive}, &wshrpc.RpcOpts{Timeout: fileTimeout})
234 if err != nil {
235 return fmt.Errorf("removing file: %w", err)
236 }
237
238 return nil
239}
240
241func fileWriteRun(cmd *cobra.Command, args []string) error {
242 path, err := fixRelativePaths(args[0])

Callers

nothing calls this directly

Calls 3

FileDeleteCommandFunction · 0.92
fixRelativePathsFunction · 0.85
GetBoolMethod · 0.80

Tested by

no test coverage detected