static-web-apps-cli icon indicating copy to clipboard operation
static-web-apps-cli copied to clipboard

swa doesn't cope with spaces in user home directories correctly

Open alexhudson opened this issue 2 years ago • 1 comments

Describe the bug

Running "swa start" fails, emitting an error:

> npx @azure/static-web-apps-cli start

Welcome to Azure Static Web Apps CLI (1.0.1)

Using configuration "test" from file:
  C:\Users\Alex Hudson\Projects\test\swa-cli.config.json

***********************************************************************
* WARNING: This emulator may not match the cloud environment exactly. *
* Always deploy and test your app in Azure.                           *
***********************************************************************

[api] 'C:\Users\Alex' is not recognized as an internal or external command,
[api] operable program or batch file.
[api] cd "C:\Users\Alex Hudson\Projects\test" && C:\Users\Alex Hudson\.swa\core-tools\v4\func start --cors "*" --port 7071  exited with code 1
--> Sending SIGTERM to other processes..

Running it manually, with correct escaping for Powershell, works:

PS C:\Users\Alex Hudson\Projects\test> & 'C:\Users\Alex Hudson\.swa\core-tools\v4\func' start --cors "*" --port 7071       
Found Python version 3.9.1 (py).

Azure Functions Core Tools
Core Tools Version:       4.0.4544 Commit hash: N/A  (32-bit)
Function Runtime Version: 4.3.2.18186

Expected behavior

If there is a space in the path to the user home, it is properly escaped before attempting to run func.

Desktop (please complete the following information):

  • OS: Windows
  • Version: 11

alexhudson avatar Jun 01 '22 10:06 alexhudson

Thanks for reporting @alexhudson ! We'll work on this fix cc// @sgollapudi77

Reshmi-Sriram avatar Jun 01 '22 10:06 Reshmi-Sriram

is there an update on this?

eiu165 avatar Nov 13 '22 13:11 eiu165