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

Function DraftHasLocalVersion

pkg/waveappstore/waveappstore.go:618–639  ·  view source on GitHub ↗
(draftAppId string)

Source from the content-addressed store, hash-verified

616}
617
618func DraftHasLocalVersion(draftAppId string) (bool, error) {
619 if err := ValidateAppId(draftAppId); err != nil {
620 return false, fmt.Errorf("invalid appId: %w", err)
621 }
622
623 appNS, appName, _ := ParseAppId(draftAppId)
624 if appNS != AppNSDraft {
625 return false, fmt.Errorf("appId must be in draft namespace, got: %s", appNS)
626 }
627
628 localAppId := MakeAppId(AppNSLocal, appName)
629 localDir, err := GetAppDir(localAppId)
630 if err != nil {
631 return false, err
632 }
633
634 if _, err := os.Stat(localDir); os.IsNotExist(err) {
635 return false, nil
636 }
637
638 return true, nil
639}
640
641// RenameLocalApp renames a local app by renaming its directories in both the local and draft namespaces.
642// It takes the current app name and the new app name (without namespace prefixes).

Callers

nothing calls this directly

Calls 5

ValidateAppIdFunction · 0.85
ParseAppIdFunction · 0.85
MakeAppIdFunction · 0.85
GetAppDirFunction · 0.85
StatMethod · 0.80

Tested by

no test coverage detected