Escape square brackets in path in PowerShell (#326)
* Escape square brackets in path in PowerShell * update changelog
This commit is contained in:
Родитель
63f22c6f1f
Коммит
b8beffe0f8
|
@ -3,6 +3,7 @@ All notable changes to the "vscode-maven" extension will be documented in this f
|
|||
|
||||
#### Fixed
|
||||
- Unexpected insertion of code snippets. [#310](https://github.com/microsoft/vscode-maven/issues/310)
|
||||
- Cannot create Maven project when target directory has brackets and default shell is PowerShell. [#324](https://github.com/microsoft/vscode-maven/issues/324)
|
||||
|
||||
## 0.16.2
|
||||
#### Fixed
|
||||
|
|
|
@ -101,7 +101,10 @@ async function getCDCommand(cwd: string): Promise<string> {
|
|||
case WindowsShellType.GIT_BASH:
|
||||
return `cd "${cwd.replace(/\\+$/, "")}"`; // Git Bash: remove trailing '\'
|
||||
case WindowsShellType.POWER_SHELL:
|
||||
return `cd "${cwd}"`; // PowerShell
|
||||
// Escape '[' and ']' in PowerShell
|
||||
// See: https://github.com/microsoft/vscode-maven/issues/324
|
||||
const escaped: string = cwd.replace(/([\[\]])/g, "``$1");
|
||||
return `cd "${escaped}"`; // PowerShell
|
||||
case WindowsShellType.CMD:
|
||||
return `cd /d "${cwd}"`; // CMD
|
||||
case WindowsShellType.WSL:
|
||||
|
|
Загрузка…
Ссылка в новой задаче