Fix `android` command

Summary: public

We've recently tweak `Config.js` so that it changes the current working directory to be able to keep track of it when running functions on the config instances. Turns out we can't do this as some commands rely on the current path (i.e.: `android`).

Although for this specific command we could fix the issue by using several `../` I feel like changing the cwd could bring other weird problems in the future, so I'm reverting the last update I did to D2565954.

Reviewed By: foghina

Differential Revision: D2572172

fb-gh-sync-id: 8cba62228b19a7729efcfe240a2f00e9becda61f
This commit is contained in:
Martín Bigio 2015-10-23 09:51:37 -07:00 committed by facebook-github-bot-8
parent 039dab078a
commit dad45aa8f2
1 changed files with 3 additions and 3 deletions

View File

@ -25,12 +25,12 @@ let cachedConfig = null;
* error will be thrown.
*/
const Config = {
get(pwd, defaultConfig) {
get(cwd, defaultConfig) {
if (cachedConfig) {
return cachedConfig;
}
const parentDir = findParentDirectory(pwd, RN_CLI_CONFIG);
const parentDir = findParentDirectory(cwd, RN_CLI_CONFIG);
if (!parentDir && !defaultConfig) {
throw new Error(
'Can\'t find "rn-cli.config.js" file in any parent folder of "' +
@ -43,7 +43,7 @@ const Config = {
: {};
cachedConfig = Object.assign({}, defaultConfig, config);
process.chdir(pwd);
cachedConfig.cwd = cwd;
return cachedConfig;
}
};