capacitor-community / capacitor-community/electron
npx cap add @capacitor-community/electron fails if there's a space in the path.
- Dominant language
- TypeScript
- Stars
- 398
- Forks
- 63
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Running `npx cap add @capacitor-community/electron` fails if there's a space anywhere in the path name.
Error thrown for dir `/Users/person/path-with space`:
```bash
Adding Electron platform:
node:internal/process/promises:392
new UnhandledPromiseRejection(reason);
^
UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "/bin/sh: line 0: cd: /Users/person/path-with : No such file or directory
```
**To Reproduce**
Steps to reproduce the behavior:
1. Make a folder with a space somewhere in the path.
2. Follow the official [getting started](https://capacitor-community.github.io/electron/docs/gettingstarted) steps.
2. Run step 3: `npx cap add @capacitor-community/electron`
3. See the error.
**Expected behavior**
Commands should properly escape spaces and other special characters in paths, and run without errors.
**Desktop (please complete the following information):**
- OS: MacOS 15.5
- Npm:
```
"@capacitor-community/electron": "^5.0.1",
"@capacitor-community/keep-awake": "^7.0.0",
"@capacitor/android": "^7.2.0",
"@capacitor/cli": "^7.2.0",
"@capacitor/core": "^7.2.0",
"@capacitor/ios": "^7.2.0",
```
Thanks!
Contributor guide
Assessment
This issue has not been assessed yet.