Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Better handle spaces in project path",
"packageName": "@react-native-windows/cli",
"email": "[email protected]",
"dependentChangeType": "patch"
}
6 changes: 3 additions & 3 deletions packages/@react-native-windows/cli/src/healthChecks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function getHealthChecks(): HealthCheckCategory[] | undefined {
'react-native-windows/package.json',
{paths: [process.cwd()]})), 'Scripts/rnw-dependencies.ps1');

const rnwDeps = execSync(`powershell -ExecutionPolicy Unrestricted -NoProfile ${rnwDepScriptPath} -NoPrompt -ListChecks`);
const rnwDeps = execSync(`powershell -ExecutionPolicy Unrestricted -NoProfile "${rnwDepScriptPath}" -NoPrompt -ListChecks`);
const deps = rnwDeps.toString().trim().split('\n');
return [
{
Expand All @@ -39,7 +39,7 @@ export function getHealthChecks(): HealthCheckCategory[] | undefined {
getDiagnostics: async () => {
let needsToBeFixed = true;
try {
await execa(`powershell -ExecutionPolicy Unrestricted -NoProfile ${rnwDepScriptPath} -NoPrompt -Check ${id}`);
await execa(`powershell -ExecutionPolicy Unrestricted -NoProfile "${rnwDepScriptPath}" -NoPrompt -Check ${id}`);
needsToBeFixed = false;
} catch {
}
Expand All @@ -48,7 +48,7 @@ export function getHealthChecks(): HealthCheckCategory[] | undefined {
}
},
runAutomaticFix: async ({ loader, logManualInstallation }) => {
const command = `powershell -ExecutionPolicy Unrestricted -NoProfile ${rnwDepScriptPath} -Check ${id}`;
const command = `powershell -ExecutionPolicy Unrestricted -NoProfile "${rnwDepScriptPath}" -Check ${id}`;
try {
const { exitCode } = await execa(command, { stdio: 'inherit' });
if (exitCode) {
Expand Down