From dad45aa8f2eac98f52c76e73d8eaa50587861888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Bigio?= Date: Fri, 23 Oct 2015 09:51:37 -0700 Subject: [PATCH] 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 --- private-cli/src/util/Config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/private-cli/src/util/Config.js b/private-cli/src/util/Config.js index 5ac0c7221..18785480c 100644 --- a/private-cli/src/util/Config.js +++ b/private-cli/src/util/Config.js @@ -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; } };