-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Absolute paths fail on Windows due to backslash #4
Comments
@avih Thanks! Look for this in 0.0.6 |
Thanks, but I think that while 8721585 indeed fixed it, your followup commit on that line (d70a472) broke it again. The additional condition |
It looks to me like it should fix it. Unfortunately, and while it's probably simple, I haven't tried yet to edit the typescript sources (haven't used typescript before), and so my debugging and testing involves editing the generated javascript files, and luckily vscode doesn't recompile the typescript files on every run, so it's sustainable to a degree. Bottom line, I can't test it yet, but the solution is probably simple: just make sure before and after that both strings have their slashes normalized. |
This still happened on 0.0.7 and still happens with 0.1.0, at least on some cases. Locally I modified I think the correct thing would be that I also think it would be a good idea if you could test on windows too. As it turns out, too many issues seem to slip between the cracks, I'm guessing, because you don't have a system to test it on. |
@avih Ugh sorry -- pushed 0.1.1. Yeah, I haven't been testing at all on Windows. I do have access but just haven't had the time to dedicate to getting that spun up and working for testing. :( |
0.1.1 doesn't fix it either. Recall You need to normalize both before you do your thing, and then again at the end (which you do already). And judging by the past, you really should test also on windows if you intend it for windows users too. |
0.1.2 works as far as I can tell. Thanks :) |
Fixes gitkraken#4 The Markdown script should be rendered on the VSCode side
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. |
Currently the code at
src/git.ts
looks as follows, which seem to intend to normalize backslashes to slashes:However, on Windows
path.relative
appears to return paths with backslashes - which makes the git commands fail. The node docs seems to support it - https://nodejs.org/api/path.html#path_path_relative_from_to (note that at the example the absolute path is with backslashes, while in your code it's with slashes, however, it still seems to return backslashes).I'd suggest to rewrite it like so:
The text was updated successfully, but these errors were encountered: