(draftAppId string)
| 616 | } |
| 617 | |
| 618 | func 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). |
nothing calls this directly
no test coverage detected