2 Star 1 Fork 0

UnPourTous/react-native

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
findXcodeProject.js 944 Bytes
一键复制 编辑 原始数据 按行查看 历史
Alex Kotliarskyi 提交于 2016-01-06 09:11 +08:00 . Added react-native run-ios
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow
*/
'use strict';
const path = require('path');
type ProjectInfo = {
name: string;
isWorkspace: boolean;
}
function findXcodeProject(files: Array<string>): ?ProjectInfo {
const sortedFiles = files.sort();
for (let i = sortedFiles.length - 1; i >= 0; i--) {
const fileName = files[i];
const ext = path.extname(fileName);
if (ext === '.xcworkspace') {
return {
name: fileName,
isWorkspace: true,
};
}
if (ext === '.xcodeproj') {
return {
name: fileName,
isWorkspace: false,
};
}
}
return null;
}
module.exports = findXcodeProject;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/UnPourTous/react-native.git
git@gitee.com:UnPourTous/react-native.git
UnPourTous
react-native
react-native
v0.51.1-master

搜索帮助