mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
add installation search path to tools discovery (#8687)
This commit is contained in:
@@ -180,7 +180,6 @@ export abstract class ToolBase implements ITool {
|
|||||||
try {
|
try {
|
||||||
this.status = ToolStatus.Installing;
|
this.status = ToolStatus.Installing;
|
||||||
await this.installCore();
|
await this.installCore();
|
||||||
await this.addInstallationSearchPathsToSystemPath();
|
|
||||||
this.startVersionAndStatusUpdate();
|
this.startVersionAndStatusUpdate();
|
||||||
await this._pendingVersionAndStatusUpdate;
|
await this._pendingVersionAndStatusUpdate;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -222,7 +221,7 @@ export abstract class ToolBase implements ITool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected async addInstallationSearchPathsToSystemPath(): Promise<void> {
|
protected async addInstallationSearchPathsToSystemPath(): Promise<void> {
|
||||||
const searchPaths = [...await this.getSearchPaths(), this.storagePath].filter(path => !!path);
|
const searchPaths = [...(new Set<string>([...await this.getSearchPaths(), this.storagePath].filter(path => !!path))).values()]; // collect all unique installation search paths
|
||||||
this.logToOutputChannel(localize('toolBase.addInstallationSearchPathsToSystemPath.SearchPaths', "Search Paths for tool '{0}': {1}", this.displayName, JSON.stringify(searchPaths, undefined, '\t'))); //this.displayName is localized and searchPaths are OS filesystem paths.
|
this.logToOutputChannel(localize('toolBase.addInstallationSearchPathsToSystemPath.SearchPaths', "Search Paths for tool '{0}': {1}", this.displayName, JSON.stringify(searchPaths, undefined, '\t'))); //this.displayName is localized and searchPaths are OS filesystem paths.
|
||||||
searchPaths.forEach(searchPath => {
|
searchPaths.forEach(searchPath => {
|
||||||
if (process.env.PATH) {
|
if (process.env.PATH) {
|
||||||
@@ -237,9 +236,6 @@ export abstract class ToolBase implements ITool {
|
|||||||
|
|
||||||
public async loadInformation(): Promise<void> {
|
public async loadInformation(): Promise<void> {
|
||||||
await this._pendingVersionAndStatusUpdate;
|
await this._pendingVersionAndStatusUpdate;
|
||||||
if (this.status === ToolStatus.NotInstalled) {
|
|
||||||
await this.addInstallationSearchPathsToSystemPath();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private startVersionAndStatusUpdate() {
|
private startVersionAndStatusUpdate() {
|
||||||
@@ -248,6 +244,7 @@ export abstract class ToolBase implements ITool {
|
|||||||
|
|
||||||
private async updateVersionAndStatus(): Promise<void> {
|
private async updateVersionAndStatus(): Promise<void> {
|
||||||
this._statusDescription = '';
|
this._statusDescription = '';
|
||||||
|
await this.addInstallationSearchPathsToSystemPath();
|
||||||
const commandOutput = await this._platformService.runCommand(
|
const commandOutput = await this._platformService.runCommand(
|
||||||
this.versionCommand.command,
|
this.versionCommand.command,
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user