[ReactNative] Adjust packager default root when running from within node_modules

This commit is contained in:
Alex Kotliarskyi 2015-03-20 16:31:31 -07:00
parent 0c5f9e3662
commit 33b46c3ba9
1 changed files with 6 additions and 1 deletions

View File

@ -38,7 +38,12 @@ if (options.projectRoots) {
options.projectRoots = options.projectRoots.split(',');
}
} else {
options.projectRoots = [path.resolve(__dirname, '..')];
if (__dirname.match(/node_modules\/react-native\/packager$/)) {
// packager is running from node_modules of another project
options.projectRoots = [path.resolve(__dirname, '../../..')];
} else {
options.projectRoots = [path.resolve(__dirname, '..')];
}
}
if (options.root) {