diff --git a/breaking-changes.txt b/breaking-changes.txt new file mode 100644 index 000000000..fcd61fe41 --- /dev/null +++ b/breaking-changes.txt @@ -0,0 +1,3 @@ +0.14: +- D2530161: Need to introduce rn-cli.config.js for existing projects + diff --git a/private-cli/src/cli.js b/private-cli/src/cli.js index 679c46d00..563ddde73 100644 --- a/private-cli/src/cli.js +++ b/private-cli/src/cli.js @@ -27,7 +27,7 @@ const hiddenCommands = { * Programmatic entry point for the cli. This function runs the given * command passing it the arguments array. */ -function run(command, commandArgs) { +function run(pwd, command, commandArgs) { if (!command) { throw new Error(helpMessage()); } @@ -38,7 +38,7 @@ function run(command, commandArgs) { throw new Error(helpMessage(command)); } - commandToExec(commandArgs, Config.get()).done(); + commandToExec(commandArgs, Config.get(pwd)).done(); } function helpMessage(command) { diff --git a/private-cli/src/util/Config.js b/private-cli/src/util/Config.js index ccd2a43c8..c6bfd3bbc 100644 --- a/private-cli/src/util/Config.js +++ b/private-cli/src/util/Config.js @@ -20,12 +20,12 @@ let cachedConfig = null; * It has to be on any parent directory of the cli. */ const Config = { - get() { + get(pwd) { if (cachedConfig) { return cachedConfig; } - const parentDir = findParentDirectory(__dirname, RN_CLI_CONFIG); + const parentDir = findParentDirectory(pwd, RN_CLI_CONFIG); if (!parentDir) { throw new Error(