Skip to content

Commit 9779c46

Browse files
MauriceChocoSwissdominikghaoqunjiang
authored
fix: update regex to allow whitespace & + in Windows path (#74)
Co-authored-by: Dominik G. <[email protected]> Co-authored-by: Haoqun Jiang <[email protected]>
1 parent 7984cc3 commit 9779c46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/launch-editor/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ function launchEditor (file, specifiedEditor, onErrorCallback) {
106106
// and
107107
// https://github.com/facebook/create-react-app/pull/5431)
108108

109-
// Allows alphanumeric characters, periods, dashes, slashes, and underscores.
110-
const WINDOWS_CMD_SAFE_FILE_NAME_PATTERN = /^([A-Za-z]:[/\\])?[\p{L}0-9/.\-_\\]+$/u
109+
// Allows alphanumeric characters, periods, dashes, slashes, underscores, plus and space.
110+
const WINDOWS_CMD_SAFE_FILE_NAME_PATTERN = /^([A-Za-z]:[/\\])?[\p{L}0-9/.\-\\_+ ]+$/u
111111
if (
112112
process.platform === 'win32' &&
113113
!WINDOWS_CMD_SAFE_FILE_NAME_PATTERN.test(fileName.trim())

0 commit comments

Comments
 (0)