Skip to content

Commit

Permalink
Warn when FacebookSDK is missing from ~/Documents (fbsamples#209)
Browse files Browse the repository at this point in the history
Without FacebookSDK in ~/Documents, the iOS Xcode project will not
compile, spewing error messages that are hard to trace back to missing
FacebookSDK for people who are new to Xcode.
  • Loading branch information
frantic authored Apr 5, 2018
1 parent c037297 commit 7b997be
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/open-ios-project.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,20 @@
*/

const fs = require("fs");
const path = require("path");
const { exec } = require("child_process");
const xcode = require("xcode");

const { HOME } = process.env;
if (HOME && !fs.existsSync(path.join(HOME, "Documents/FacebookSDK"))) {
console.log("WARNING: Facebook SDK is not found in ~/Documents/FacebookSDK");
console.log(
"Please download Facebook SDK from https://developers.facebook.com/docs/ios/"
);
console.log("and put it in ~/Documents/FacebookSDK");
process.exit(1);
}

const projectPath =
"node_modules/react-native-native-video-player/ios/RNVideoPlayer.xcodeproj/project.pbxproj";
const project = xcode.project(projectPath);
Expand Down

0 comments on commit 7b997be

Please sign in to comment.