Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Create Maven Project' doesn't work correctly when the directory has brackets on Windows #324

Closed
FacundoCerezo opened this issue May 10, 2019 · 2 comments
Assignees
Labels
bug Something isn't working completed
Milestone

Comments

@FacundoCerezo
Copy link

Describe the bug
This happens when one tries to create a new Maven Project through the Java Overview page, selects an archetype and selects a directory with brackets in the path. The Terminal uses Powershell.

As Powershell takes brackets as a wildcard when doing a cd in the Terminal, VS Code won't successfully change directory in the Terminal, showing an error. As a result, it will try to generate a Maven Project in my user path (C:\Users\User).

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Java Overview' page
  2. Click on 'Create a Maven Project...'
  3. Select any archetype
  4. Select a directory path with brackets (e.g: C:\dev\java\projects_[2019]\example)
  5. See "directory doesn't exist" error in PowerShell

Expected behavior
VS Code should successfully change directory to that path, or at the very least, abort the operation to avoid creating projects in a wrong path.

Possible solution

  • Use -LiteralPath flag with cd command
    -- not working in Powershell < 3

Environments (please complete the following information as much as possible):

  • Operating System: Windows 10 1809 (17763.475) [es-AR]
  • Visual Studio Code version: 1.33.1
  • Extension version: 0.16.2
@Eskibear
Copy link
Member

Use -LiteralPath flag with cd command

It causes regressions for Powershell 2.x users as you mentioned. I myself prefer to escape special characters for Powershell. It is a little bit dirty, but effective and safe.

@Eskibear Eskibear added the bug Something isn't working label May 12, 2019
@Eskibear Eskibear added this to the 0.17.0 milestone May 12, 2019
@Eskibear Eskibear self-assigned this May 13, 2019
@FacundoCerezo
Copy link
Author

Closing issue as it was resolved in #326.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working completed
Projects
None yet
Development

No branches or pull requests

2 participants