Skip to content

Commit

Permalink
Fix CLI Error when there is no windows project
Browse files Browse the repository at this point in the history
Summary:
Running `master` (at 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 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 #11590

Differential Revision: D4362419

fbshipit-source-id: b3b9f6784d8b1d1a7c53abe0ee421b1dc6048571
  • Loading branch information
rh389 authored and facebook-github-bot committed Dec 22, 2016
1 parent f625437 commit 5927646
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion local-cli/core/config/windows/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ const getProjectName = (fullProjPath) => {
exports.projectConfig = function projectConfigWindows(folder, userConfig) {

const csSolution = userConfig.csSolution || findWindowsSolution(folder);
const solutionPath = path.join(folder, csSolution);

if (!csSolution) {
return null;
}

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

0 comments on commit 5927646

Please sign in to comment.