mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-05 09:35:39 -05:00
This change adds to handlers to unexpected promise rejection scenarios. This PR fixes #8640 * add handlers for promise rejections * Displaying all tools load errors * Update toolBase.ts - setting errorMessage to be displayed in the additional information field * disable the select button when tools not discovered * PR fixes
53 lines
1.6 KiB
TypeScript
53 lines
1.6 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
import { SemVer } from 'semver';
|
|
import * as nls from 'vscode-nls';
|
|
import { Command, ToolType, OsDistribution } from '../../interfaces';
|
|
import { IPlatformService } from '../platformService';
|
|
import { ToolBase } from './toolBase';
|
|
|
|
const localize = nls.loadMessageBundle();
|
|
|
|
export class DockerTool extends ToolBase {
|
|
protected discoveryCommand: Command = { command: '' };
|
|
constructor(platformService: IPlatformService) {
|
|
super(platformService);
|
|
}
|
|
|
|
get name(): string {
|
|
return 'docker';
|
|
}
|
|
|
|
get description(): string {
|
|
return localize('resourceDeployment.DockerDescription', "Packages and runs applications in isolated containers");
|
|
}
|
|
|
|
get type(): ToolType {
|
|
return ToolType.Docker;
|
|
}
|
|
|
|
get displayName(): string {
|
|
return localize('resourceDeployment.DockerDisplayName', "docker");
|
|
}
|
|
|
|
get homePage(): string {
|
|
return 'https://docs.docker.com/install';
|
|
}
|
|
|
|
protected getVersionFromOutput(output: string): SemVer | undefined {
|
|
let version: SemVer | undefined = undefined;
|
|
if (output) {
|
|
version = new SemVer(JSON.parse(output).Client.Version, true);
|
|
}
|
|
return version;
|
|
}
|
|
|
|
protected get versionCommand(): Command {
|
|
return { command: 'docker version --format "{{json .}}"' };
|
|
}
|
|
|
|
protected readonly allInstallationCommands: Map<OsDistribution, Command[]> = new Map<OsDistribution, Command[]>();
|
|
}
|