microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
dev/v-peq/add-network-inspector-server-tests

Branches

Tags

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

Clone

HTTPS

Download ZIP

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

43lines · modecode

1// 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({
9 messageFormat: nls.MessageFormat.bundle,
10 bundleFormat: nls.BundleFormat.standalone,
11})();
12const toLocale = nls.loadMessageBundle();
13
14const label = ".NET Core 3.1";
15
16async function test(): Promise<ValidationResultT> {
17 const command = "dotnet --info";
18 const data = await executeCommand(command);
19 if (data.stdout) {
20 if (data.stdout.includes("Microsoft.NETCore.App 3.1"))
21 return {
22 status: "success",
23 };
24 return {
25 status: "failure",
26 comment: createVersionErrorMessage(label),
27 };
28 }
29 return {
30 status: "failure",
31 comment: createNotFoundMessage(label),
32 };
33}
34
35const main: IValidation = {
36 label,
37 platform: ["win32"],
38 description: toLocale("DotNetTestDescription", "Required for building RNW apps"),
39 category: ValidationCategoryE.Windows,
40 exec: test,
41};
42
43export default main;
44