|
6 | 6 | import * as fs from 'fs/promises';
|
7 | 7 | import * as JSYAML from 'js-yaml';
|
8 | 8 | import * as path from 'path';
|
| 9 | +import { which } from 'shelljs'; |
9 | 10 | import { commands, debug, DebugConfiguration, DebugSession, Disposable, EventEmitter, extensions, ProgressLocation, Uri, window, workspace } from 'vscode';
|
10 | 11 | import { Oc } from '../oc/ocWrapper';
|
11 | 12 | import { Command } from '../odo/command';
|
@@ -219,12 +220,23 @@ export class Component extends OpenShiftItem {
|
219 | 220 | if (await Odo.Instance.isPodmanPresent()) {
|
220 | 221 | return true;
|
221 | 222 | }
|
222 |
| - void window.showErrorMessage('Podman is not present in the system, please install podman on your machine and try again.', 'Install podman') |
223 |
| - .then(async (result) => { |
224 |
| - if (result === 'Install podman') { |
225 |
| - await commands.executeCommand('vscode.open', Uri.parse('https://podman.io/')); |
226 |
| - } |
227 |
| - }); |
| 223 | + const podmanOnPath = which('podman'); |
| 224 | + if (podmanOnPath) { |
| 225 | + const SETUP_INSTRUCTIONS = 'Open setup instructions'; |
| 226 | + void window.showErrorMessage('Podman is present on the system, but is not fully set up yet.', SETUP_INSTRUCTIONS) |
| 227 | + .then(result => { |
| 228 | + if (result === SETUP_INSTRUCTIONS) { |
| 229 | + void commands.executeCommand('vscode.open', Uri.parse('https://podman.io/docs/installation')); |
| 230 | + } |
| 231 | + }); |
| 232 | + } else { |
| 233 | + void window.showErrorMessage('Podman is not present in the system, please install podman on your machine and try again.', 'Install podman') |
| 234 | + .then(async (result) => { |
| 235 | + if (result === 'Install podman') { |
| 236 | + await commands.executeCommand('vscode.open', Uri.parse('https://podman.io/')); |
| 237 | + } |
| 238 | + }); |
| 239 | + } |
228 | 240 | return false;
|
229 | 241 | }
|
230 | 242 |
|
|
0 commit comments