MCPcopy
hub / github.com/wavetermdev/waveterm / DeleteAppFile

Function DeleteAppFile

pkg/waveappstore/waveappstore.go:320–340  ·  view source on GitHub ↗
(appId string, fileName string)

Source from the content-addressed store, hash-verified

318}
319
320func DeleteAppFile(appId string, fileName string) error {
321 if err := ValidateAppId(appId); err != nil {
322 return fmt.Errorf("invalid appId: %w", err)
323 }
324
325 appDir, err := GetAppDir(appId)
326 if err != nil {
327 return err
328 }
329
330 filePath, err := validateAndResolveFilePath(appDir, fileName)
331 if err != nil {
332 return err
333 }
334
335 if err := os.Remove(filePath); err != nil {
336 return fmt.Errorf("failed to delete file: %w", err)
337 }
338
339 return nil
340}
341
342func ReplaceInAppFile(appId string, fileName string, edits []fileutil.EditSpec) error {
343 if err := ValidateAppId(appId); err != nil {

Callers 1

DeleteAppFileCommandMethod · 0.92

Calls 3

ValidateAppIdFunction · 0.85
GetAppDirFunction · 0.85

Tested by

no test coverage detected