microsoft/vscode-react-native
Publicmirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable
src/debugger/ios/xcodeproj.ts
21lines · 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 | |
| 4 | import * as path from "path"; |
| 5 | import * as Q from "q"; |
| 6 | |
| 7 | import {Log} from "../../utils/commands/log"; |
| 8 | import {Node} from "../../utils/node/node"; |
| 9 | |
| 10 | export class Xcodeproj { |
| 11 | public findXcodeprojFile(projectRoot: string): Q.Promise<string> { |
| 12 | return new Node.FileSystem() |
| 13 | .findFilesByExtension(path.join(projectRoot, "ios"), "xcodeproj") |
| 14 | .then((projectFiles: string[]) => { |
| 15 | if (projectFiles.length > 1) { |
| 16 | Log.logError(`Warning: more than one xcodeproj found. Using ${projectFiles[0]}`); |
| 17 | } |
| 18 | return projectFiles[0]; |
| 19 | }); |
| 20 | } |
| 21 | } |