Skip to content

Commit

Permalink
plugin: update script paths for react-native 0.59
Browse files Browse the repository at this point in the history
Updates the postlink script paths to use the new local cli location
from react-native 0.59.

Ref: #8
Thanks: https://github.com/coreyphillips
Thanks: https://github.com/unmec
  • Loading branch information
jaimecbernardo committed Mar 18, 2019
1 parent 6da18f7 commit ba9d5d4
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions scripts/module-postlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,22 @@ var path = require('path');
var fs = require('fs');
var ncp = require('ncp');
var xcode = require('xcode');
const android = require('./../../../node_modules/react-native/local-cli/core/android');
const ios = require('./../../../node_modules/react-native/local-cli/core/ios');

var android;
try {
android = require('./../../../node_modules/@react-native-community/cli/build/tools/android');
} catch (ex) {
// Older version of react-native, try to load cli from inside react-native.
android = require('./../../../node_modules/react-native/local-cli/core/android');
}

var ios;
try {
ios = require('./../../../node_modules/@react-native-community/cli/build/tools/ios');
} catch (ex) {
// Older version of react-native, try to load cli from inside react-native.
ios = require('./../../../node_modules/react-native/local-cli/core/ios');
}

function hostPackageDir(file) {
var pathComponents = file.split(path.sep);
Expand Down

0 comments on commit ba9d5d4

Please sign in to comment.