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

Function ReplaceInAppFilePartial

pkg/waveappstore/waveappstore.go:360–376  ·  view source on GitHub ↗
(appId string, fileName string, edits []fileutil.EditSpec)

Source from the content-addressed store, hash-verified

358}
359
360func ReplaceInAppFilePartial(appId string, fileName string, edits []fileutil.EditSpec) ([]fileutil.EditResult, error) {
361 if err := ValidateAppId(appId); err != nil {
362 return nil, fmt.Errorf("invalid appId: %w", err)
363 }
364
365 appDir, err := GetAppDir(appId)
366 if err != nil {
367 return nil, err
368 }
369
370 filePath, err := validateAndResolveFilePath(appDir, fileName)
371 if err != nil {
372 return nil, err
373 }
374
375 return fileutil.ReplaceInFilePartial(filePath, edits)
376}
377
378func RenameAppFile(appId string, fromFileName string, toFileName string) error {
379 if err := ValidateAppId(appId); err != nil {

Callers 1

Calls 4

ReplaceInFilePartialFunction · 0.92
ValidateAppIdFunction · 0.85
GetAppDirFunction · 0.85

Tested by

no test coverage detected