-
Notifications
You must be signed in to change notification settings - Fork 676
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the dotnet bundle api to get dotnet path
- Loading branch information
Showing
3 changed files
with
33 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
import * as vscode from "vscode"; | ||
|
||
const dotnetPackExtensionId = "ms-dotnettools.vscode-dotnet-pack"; | ||
|
||
export interface DotnetPackExtensionExports { | ||
getDotnetPath(version?: string): Promise<string | undefined>; | ||
} | ||
|
||
export async function getDotnetPackApi(): Promise<DotnetPackExtensionExports> { | ||
const dotnetExtension = vscode.extensions.getExtension<DotnetPackExtensionExports>(dotnetPackExtensionId); | ||
if (!dotnetExtension) { | ||
return null; | ||
} | ||
|
||
if (!dotnetExtension.isActive) { | ||
await dotnetExtension.activate(); | ||
} | ||
|
||
return dotnetExtension.exports; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters