Permalink
Browse files

Fix CLI Error when there is no windows project

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 59276468f289adfec418768366086882453878ea
Showing with 1 addition and 1 deletion.
  1. +1 −1 local-cli/core/config/windows/index.js
@@ -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);

0 comments on commit 5927646

Please sign in to comment.