(payload: AnyDesktopActionPayload)
| 135 | } |
| 136 | |
| 137 | async function createProjectFromPayload(payload: AnyDesktopActionPayload) { |
| 138 | const appSettings = loadAppSettings() |
| 139 | const repoUrl = typeof payload.repoUrl === 'string' ? payload.repoUrl.trim() : '' |
| 140 | return repoUrl |
| 141 | ? await createProjectFromGitHubUrl({ |
| 142 | preferredProjectLocation: appSettings.preferredProjectLocation, |
| 143 | repositoryUrl: repoUrl, |
| 144 | }) |
| 145 | : await createProject({ |
| 146 | preferredProjectLocation: appSettings.preferredProjectLocation, |
| 147 | projectName: getProjectName(payload) ?? '', |
| 148 | initializeGit: appSettings.initializeGitOnProjectCreate, |
| 149 | }) |
| 150 | } |
| 151 | |
| 152 | function getProjectDeletionBlockedError(projectId: string) { |
| 153 | if (!hasProject(projectId)) return 'Cannot delete a project that is not managed by Pi.' |
no test coverage detected