Skip to content

Commit 5927646

Browse files
rh389facebook-github-bot
authored andcommitted
Fix CLI Error when there is no windows project
Summary: Running `master` (at facebook@260d68b) I noticed `react-native link` fails when there is no windows project due to a bug in the code that fetches windows project configs (introduced facebook@445182c). There's a guard to return early if `csSolution` (the relative path of the windows solution) is null but it needs to be a line earlier, because `path.join` errors when passed a non-string. Tested locally on a non-windows project, `react-native link` errored previously and now succeeds. Closes facebook#11590 Differential Revision: D4362419 fbshipit-source-id: b3b9f6784d8b1d1a7c53abe0ee421b1dc6048571
1 parent f625437 commit 5927646

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

local-cli/core/config/windows/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ const getProjectName = (fullProjPath) => {
3434
exports.projectConfig = function projectConfigWindows(folder, userConfig) {
3535

3636
const csSolution = userConfig.csSolution || findWindowsSolution(folder);
37-
const solutionPath = path.join(folder, csSolution);
3837

3938
if (!csSolution) {
4039
return null;
4140
}
4241

4342
// expects solutions to be named the same as project folders
43+
const solutionPath = path.join(folder, csSolution);
4444
const windowsAppFolder = csSolution.substring(0, csSolution.lastIndexOf(".sln"));
4545
const src = userConfig.sourceDir || windowsAppFolder;
4646
const sourceDir = path.join(folder, src);

0 commit comments

Comments
 (0)