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

Function ReplaceInAppFile

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

Source from the content-addressed store, hash-verified

340}
341
342func ReplaceInAppFile(appId string, fileName string, edits []fileutil.EditSpec) error {
343 if err := ValidateAppId(appId); err != nil {
344 return fmt.Errorf("invalid appId: %w", err)
345 }
346
347 appDir, err := GetAppDir(appId)
348 if err != nil {
349 return err
350 }
351
352 filePath, err := validateAndResolveFilePath(appDir, fileName)
353 if err != nil {
354 return err
355 }
356
357 return fileutil.ReplaceInFile(filePath, edits)
358}
359
360func ReplaceInAppFilePartial(appId string, fileName string, edits []fileutil.EditSpec) ([]fileutil.EditResult, error) {
361 if err := ValidateAppId(appId); err != nil {

Callers

nothing calls this directly

Calls 4

ReplaceInFileFunction · 0.92
ValidateAppIdFunction · 0.85
GetAppDirFunction · 0.85

Tested by

no test coverage detected