Skip to content

Commit

Permalink
add custom picker
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink committed Mar 19, 2024
1 parent 41f05f2 commit 31adac5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions extension/src/flow-cli/cli-selection-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,18 @@ export class CliSelectionProvider implements vscode.Disposable {
const selected = versionSelector.selectedItems[0]

if (selected instanceof CustomBinaryItem) {
void vscode.window.showInputBox({
placeHolder: 'Enter the path to the Flow CLI binary',
prompt: 'Enter the path to the Flow CLI binary'
}).then((path) => {
if (path != null) {
this.#cliProvider.setCurrentBinary(path)
void vscode.window.showOpenDialog({
canSelectFiles: true,
canSelectFolders: false,
canSelectMany: false,
openLabel: 'Choose a Flow CLI binary'
}).then((uri) => {
if (uri != null) {
void this.#cliProvider.setCurrentBinary(uri[0].fsPath)
}
})
} else if (selected instanceof AvailableBinaryItem) {
this.#cliProvider.setCurrentBinary(selected.path)
void this.#cliProvider.setCurrentBinary(selected.path)
}
}))

Expand Down

0 comments on commit 31adac5

Please sign in to comment.