(gitExecutable: string)
| 240 | } |
| 241 | |
| 242 | private async promptForFlutterClone(gitExecutable: string): Promise<{ folder?: string, result: CloneSdkResult }> { |
| 243 | const selectedFolders = |
| 244 | await window.showOpenDialog({ |
| 245 | defaultUri: Uri.file(os.homedir()), |
| 246 | canSelectFiles: false, |
| 247 | canSelectFolders: true, |
| 248 | canSelectMany: false, |
| 249 | openLabel: `Clone Flutter`, |
| 250 | title: "Select Folder for Flutter SDK", |
| 251 | }); |
| 252 | if (selectedFolders?.length === 1) { |
| 253 | const workingDirectory = fsPath(selectedFolders[0]); |
| 254 | const cloneResult = await this.cloneFlutterWithProgress(gitExecutable, workingDirectory); |
| 255 | const didClone = cloneResult === GitOperationResult.success; |
| 256 | |
| 257 | const result = cloneResult === GitOperationResult.success |
| 258 | ? CloneSdkResult.succeeded |
| 259 | : cloneResult === GitOperationResult.cancelled |
| 260 | ? CloneSdkResult.cancelled |
| 261 | : CloneSdkResult.failed; |
| 262 | this.analytics.logGitCloneSdk(result); |
| 263 | |
| 264 | return { result, folder: didClone ? path.join(workingDirectory, "flutter") : undefined }; |
| 265 | } |
| 266 | |
| 267 | return { result: CloneSdkResult.cancelled }; |
| 268 | } |
| 269 | |
| 270 | private async cloneFlutterWithProgress(gitExecutable: string, workingDirectory: string): Promise<GitOperationResult> { |
| 271 | const gitUrl = "https://github.com/flutter/flutter.git"; |
no test coverage detected