pnp / vscode-viva

With the SharePoint Framework Toolkit extension, you can create and manage your SharePoint Framework solutions on your tenant. All actions you need to perform during the development flow are at your fingertips.
https://marketplace.visualstudio.com/items?itemName=m365pnp.viva-connections-toolkit
MIT License
34 stars 14 forks source link

🐞 [Bug]: Serve fails if folder path has space #212

Closed Tanddant closed 2 months ago

Tanddant commented 2 months ago

📝 Describe the bug

When I press the serve button and the path to the folder has a space in it PowerShell cd fails

i.e if my project is stored at:

d:\Client name with spaces\Project 1

I'll get the following output:

cd d:\Client name with spaces\Project 1
> Set-Location: A positional parameter cannot be found that accepts argument 'name'.

👣 Steps To Reproduce

Steps to reproduce the behavior:

  1. Open a project that's stored in a path with a space in it
  2. Press the serve button

📜 Expected behavior

Serve my project.

💻 Desktop (please complete the following information):

🤔 Additional context

Seems like all that's needed is to wrap the paramater containing the path in a set of quotes, I would love to help, but I have idea where to look in the code, so if anyone can point me in a direction I would love to help fix it

Adam-it commented 2 months ago

hi @Tanddant 👋 Sorry to hear you are having trouble using SPFx Toolkit 😔 and thank you so so much for reporting the bug 🐞. From what you descried I also (as you suggested) think that the path should be just wrapped in single quotes 👍. Seems I totally forgot one may use space in folder names 😅.

... anyway. like 90% this is the place which should be fixed https://github.com/pnp/vscode-viva/blob/c11c78f5ebbbd4965c3943b6287a15cc6f7958ca/src/services/TerminalCommandExecuter.ts#L120

The TerminalCommandExecuter.runCommand method executes every of the gulp task commands. At the beginning it sets the user newly created terminal in right position which needs to be fixed.

Would you like to give it a try? I am still working on better contributing guidance on this repo as it is a bit problematic but you may always follow along with the current Contribution guidelines and if anything seems wrong or stopping you from work just let me know either here or directly 👍

Tanddant commented 2 months ago

For sure I'll give it a go! - never worked on a VS Code extension before, new stuff is always fun, feel free to assign me this task 😊

Adam-it commented 2 months ago

For sure I'll give it a go! - never worked on a VS Code extension before, new stuff is always fun, feel free to assign me this task 😊

Sold 🔨 VS Code extensions it's a world of its own 😅. Just like SPFx 😜 Let me know if you will need any help.

Adam-it commented 2 months ago

shipped with -> https://github.com/pnp/vscode-viva/actions/runs/8698251355

Adam-it commented 2 months ago

hi @Tanddant, Once again thank you for rising up the issue 👏 and solving it 🚀. You Rock 🤩 Your work was merged to dev branch as is part of the latest extension pre-release v3.0.1 pre-releases are no installed automatically and you will need to opt-in in VS Code if you wanna test out your changes and use the latest and greatest image

Let's give it a 7 day period for pre-production use and see if anything comes up. After that I will merge this to the main and will create new minor release out of that 👍 If you have any doubts or questions please do not hesitate to ask Once again thank you for your interest in making this product better 👏 Cheers mate 🍻