microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
fix-ts-error1

Branches

Tags

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

Clone

HTTPS

Download ZIP

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

44lines · 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 { 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 = "DeveloperMode";
15
16async function test(): Promise<ValidationResultT> {
17const command =
18"reg query HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AppModelUnlock /v AllowDevelopmentWithoutDevLicense";
19const data = await executeCommand(command);
20if (data.stdout) {
21if (data.stdout.includes(" 0x1"))
22return {
23status: "success",
24};
25}
26
27return {
28status: "failure",
29comment: "Developer mode is disabled",
30};
31}
32
33const main: IValidation = {
34label,
35platform: ["win32"],
36description: toLocale(
37"DeveloperModeTestDescription",
38"Required for launching and debugging RNW apps",
39),
40category: ValidationCategoryE.Windows,
41exec: test,
42};
43
44export default main;