Skip to content

Commit

Permalink
fix: allow downloading projects with ssh git links (leanprover#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuisi authored Jan 15, 2024
1 parent ea2e4f3 commit 72d7062
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions vscode-lean4/src/projectinit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,23 +141,14 @@ Open this project instead?`
}

private async cloneProject() {
const unparsedProjectUri: string | undefined = await window.showInputBox({
const projectUri: string | undefined = await window.showInputBox({
title: 'URL Input',
value: 'https://github.com/leanprover-community/mathlib4',
prompt: 'URL of Git repository for existing Lean 4 project',
validateInput: value => {
try {
Uri.parse(value, true)
return undefined // Valid URI
} catch (e) {
return 'Invalid URL'
}
}
prompt: 'URL of Git repository for existing Lean 4 project'
})
if (unparsedProjectUri === undefined) {
if (projectUri === undefined) {
return
}
const existingProjectUri = Uri.parse(unparsedProjectUri)

const projectFolder: Uri | undefined = await ProjectInitializationProvider.askForNewProjectFolderLocation({
saveLabel: 'Create project folder',
Expand All @@ -167,7 +158,7 @@ Open this project instead?`
return
}

const result: ExecutionResult = await batchExecuteWithProgress('git', ['clone', existingProjectUri.toString(), projectFolder.fsPath], 'Cloning project', { channel: this.channel, allowCancellation: true })
const result: ExecutionResult = await batchExecuteWithProgress('git', ['clone', projectUri, projectFolder.fsPath], 'Cloning project', { channel: this.channel, allowCancellation: true })
if (result.exitCode === ExecutionExitCode.Cancelled) {
return
}
Expand Down

0 comments on commit 72d7062

Please sign in to comment.