Skip to content

Commit dad45aa

Browse files
martinbigiofacebook-github-bot-8
authored andcommitted
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
1 parent 039dab0 commit dad45aa

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

private-cli/src/util/Config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ let cachedConfig = null;
2525
* error will be thrown.
2626
*/
2727
const Config = {
28-
get(pwd, defaultConfig) {
28+
get(cwd, defaultConfig) {
2929
if (cachedConfig) {
3030
return cachedConfig;
3131
}
3232

33-
const parentDir = findParentDirectory(pwd, RN_CLI_CONFIG);
33+
const parentDir = findParentDirectory(cwd, RN_CLI_CONFIG);
3434
if (!parentDir && !defaultConfig) {
3535
throw new Error(
3636
'Can\'t find "rn-cli.config.js" file in any parent folder of "' +
@@ -43,7 +43,7 @@ const Config = {
4343
: {};
4444

4545
cachedConfig = Object.assign({}, defaultConfig, config);
46-
process.chdir(pwd);
46+
cachedConfig.cwd = cwd;
4747
return cachedConfig;
4848
}
4949
};

0 commit comments

Comments
 (0)