microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
improve-configuration

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/extension/services/validationService/checks/dotnet.ts

43lines · modeblame

62af5fc4Samriel4 years ago1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3
4import * as nls from "vscode-nls";
5import { createNotFoundMessage, createVersionErrorMessage, executeCommand } from "../util";
6import { IValidation, ValidationCategoryE, ValidationResultT } from "./types";
7
8nls.config({
9messageFormat: nls.MessageFormat.bundle,
10bundleFormat: nls.BundleFormat.standalone,
11})();
12const toLocale = nls.loadMessageBundle();
13
14const label = ".NET Core 3.1";
15
16async function test(): Promise<ValidationResultT> {
17const command = "dotnet --info";
18const data = await executeCommand(command);
19if (data.stdout) {
20if (data.stdout.includes("Microsoft.NETCore.App 3.1"))
21return {
22status: "success",
23};
24return {
25status: "failure",
26comment: createVersionErrorMessage(label),
27};
28}
29return {
30status: "failure",
31comment: createNotFoundMessage(label),
32};
33}
34
35const main: IValidation = {
36label,
37platform: ["win32"],
38description: toLocale("DotNetTestDescription", "Required for building RNW apps"),
39category: ValidationCategoryE.Windows,
40exec: test,
41};
42
43export default main;