-
Notifications
You must be signed in to change notification settings - Fork 52
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
[BUG] Current folder with spaces does not watch #308
Comments
How can I push the fix to the repository? |
Hey @asinino, sorry I've been away for paternity leave at work, and trying to stay away to spend time with family. If you have WSL setup on windows, I can verify the repo works well under it. Further tooling changes would have to wait for me to be back, unless you feel like working on those and then I can review them. |
When a user has a project that contains a space in it's name the command failed because it does not escaped the space to the shell command. Fixes nx-dotnet#308
@allcontributors add asinino for code and bugs |
I've put up a pull request to add @asinino! 🎉 |
Hello I added a PR that encloses the project path + name with double quotes (present ao all commands referencing a project). |
🎉 This issue has been resolved in version 1.9.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
The test would be nice, but this is fine as-is IMHO. The Eventually, we should probably set up e2e for it, shouldn't be hard but isn't currently done. |
TLDR: watch commands fail to start. CWD is injected on spawn command also so double directory path is inserted on the command. I received this update today, and it's in a big mess, I just broke your package with my last update. TLTR: watch commands fail to start. CWD is injected on spawn command also so double directory path is inserted on the command. My proposed solution is:
The first target is going with solution B because CWD is passed down to the command. |
Hmmmm, that doesn't seem like something that should have been changed by your previous PR. We've always passed fully resolved paths to the dotnet commands, and the updates you added shouldn't have changed anything with that. Let me look into it real quick. |
I think the issue is just with how spawn handles parameters. Before we were splitting on spaces which worked fine, but now with the quotes we need to make sure we don't split them. It may be best to move the command out some. Let me do some testing. |
Ok, I'll convert the cmd into an array of arguments, it should fix the issue. I'm having some trouble testing it offline, how can I run it locally? I changed the way Verdaccio is called and now it's correctly initialized. But the command to publish-local is falling (I'll open a new issue for this and try to properly supply a fix). I don't control everything on my current machine and the environment does not allow me to have WSL :/ |
Also, change this ticket back to open because the currently applied fix is breaking the package. |
Have submitted a new fix, but please review the changes because a lot has changed. All parameters are now handled as an array, so we may not need special care for paths with spaces. But still, if someone can test this as I can't have a local version of the change, script publish-local is not working on my environment. |
Running into a very similar issue WITHOUT any spaces in the path:
Output
When executing the command listed above in bash directly the web api starts up right away no issues, for refrence this is the command that works:
Given that the issue is path based this seems rather central and I would guess that right now running dotnet apps via the serve command is broken in general in the latest version. Any timeline on a fix? |
I'm currently working on the solution for the problem, I'll give it a day. In the current state, the serve command is useless. |
CC @asinino I pushed some updates to your branch and went ahead and merged it. Going to cut a release soon to fix since its pretty urgent bug. Everything looks fine testing locally, and E2E passed. |
I can confirm this fixed the bug for us. Hella quick turnaround guys, keep it up !!! |
I couldn't test it locally, it always failed, with my version of dotnet-format it still fails because the parameter "--check" does not exist. Still, I pushed a fix to execute return the buffer from stdout. Can you see the change? Do I need another pull request? I added some notes on previous pull request #392 to the questions you have made, like why the use of spawnSync. |
@asinino Open a new issue for the |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Describe the bug
On my local computer, the project I'm working on includes spaces on the folder, trying to run 'nx serve api' bugs out with the message:
I tried to solve the problem locally and the solution is easy, on DotNetClient.run just convert the cmd variable to an array of parameters:
Do the proper changes to accumulate the function parameter 'parameters'. And to print the message on the console just do a
.join(' ')
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The project API should be served as described in the documentation.
Environment:
The text was updated successfully, but these errors were encountered: