microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
dev/v-peq/security_uuid_fix

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/extension/commands/expoDoctor.ts

25lines · 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 assert = require("assert");
5import { ErrorHelper } from "../../common/error/errorHelper";
6import { InternalErrorCode } from "../../common/error/internalErrorCode";
7import { ChildProcess } from "../../common/node/childProcess";
8import { OutputChannelLogger } from "../log/OutputChannelLogger";
9import { ReactNativeCommand } from "./util/reactNativeCommand";
10
11const logger = OutputChannelLogger.getMainChannel();
12export class expoDoctor extends ReactNativeCommand {
13 codeName = "expoDoctor";
14 label = "Expo Doctor";
15 error = ErrorHelper.getInternalError(InternalErrorCode.FailedToRunExpoDoctor);
16
17 async baseFn(): Promise<void> {
18 assert(this.project);
19 const projectRootPath = this.project.getPackager().getProjectPath();
20 const res = await new ChildProcess().exec("npx expo-doctor", { cwd: projectRootPath });
21 logger.info("Running diagnostics...");
22 const outcome = await res.outcome;
23 logger.info(outcome);
24 }
25}