microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
src/extension/services/validationService/checks/cocoaPods.ts
45lines · modeblame
c7856462Heniker4 years ago | 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for details. | |
| 3 | | |
| 4 | import * as nls from "vscode-nls"; | |
948a0d44Heniker4 years ago | 5 | import { basicCheck, createNotFoundMessage } from "../util"; |
09f6024fHeniker4 years ago | 6 | import { ValidationCategoryE, IValidation, ValidationResultT } from "./types"; |
c7856462Heniker4 years ago | 7 | |
| 8 | nls.config({ | |
| 9 | messageFormat: nls.MessageFormat.bundle, | |
| 10 | bundleFormat: nls.BundleFormat.standalone, | |
| 11 | })(); | |
| 12 | | |
| 13 | const toLocale = nls.loadMessageBundle(); | |
| 14 | | |
| 15 | const label = "CocoaPods"; | |
| 16 | | |
| 17 | async function test(): Promise<ValidationResultT> { | |
948a0d44Heniker4 years ago | 18 | const result = await basicCheck({ |
| 19 | command: "pod", | |
| 20 | }); | |
| 21 | | |
| 22 | if (!result.exists) { | |
c7856462Heniker4 years ago | 23 | return { |
| 24 | status: "failure", | |
| 25 | comment: createNotFoundMessage(label), | |
| 26 | }; | |
| 27 | } | |
| 28 | | |
| 29 | return { | |
| 30 | status: "success", | |
| 31 | }; | |
| 32 | } | |
| 33 | | |
| 34 | const main: IValidation = { | |
| 35 | label, | |
| 36 | platform: ["darwin"], | |
| 37 | description: toLocale( | |
| 38 | "CocoaPodsTestDescription", | |
| 39 | "Required for managing library dependencies of XCode projects", | |
| 40 | ), | |
| 41 | category: ValidationCategoryE.iOS, | |
| 42 | exec: test, | |
| 43 | }; | |
| 44 | | |
| 45 | export default main; |