Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-23704] Improve error when Podfile is empty #67

Merged
merged 2 commits into from
Sep 6, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion metabase/ios/lib/metabase.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ function runPodInstallIfRequired(basedir, callback) {
}
], function(err, pod, version) {
if (err) { return callback(err); }
util.logger.trace('Found pod ' + version + ' at ' + pod);
util.logger.trace('Found CocoaPods ' + version + ' (' + pod + ')');
if (semver.lt(version, '1.0.0')) {
util.logger.warn('Using a CocoaPods version below 1.0.0 is deprecated. Please update your CocoaPods installation with: sudo gem install cocoapods');
}
Expand Down Expand Up @@ -714,7 +714,15 @@ function generateCocoaPods (cachedir, basedir, appDir, sdkType, sdkVersion, minS
if (!fs.existsSync(Podfile)) {
util.logger.debug('No CocoaPods file found');
return callback();
} else {
var content = fs.readFileSync(Podfile).toString();

if (content.length && content.indexOf('pod ') == -1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always use strict equality checking.

util.logger.warn('Podfile found, but no pod\'s specified. Skipping ...');
return callback();
}
}

runPodInstallIfRequired(basedir, function (err) {
if (err) { return callback(err); }
runCocoaPodsBuild(basedir, appDir, sdkType, sdkVersion, minSDKVersion, xcodesettings, function (err, libs, libDir) {
Expand Down