-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add command fails on windows #6
Comments
Hey @wvdvegt, |
Hi, I do not have go installed nor have experience with it, but i might try if i have some spare time. Always ready to learn. |
Sounds great. Let me know how I can help or guide you a bit. |
I Installed GO and tried to follow your 'from source' installation script (on Windows). Some remarks:
|
I mostly get no Go files in C:\Users\xxx\go\src\github.com\andygrunwald\perseus type of errors when I run go install. |
Hi In dependency/repository/packagist.go the lines:
should be changed to:
to at least get it downloading (not sure if it totally works). The main issue is that filePath.Clean() method seems to replace all / and \ by the operating system's directory separator char (so the original /twig/twig gets changed into \twig\twig resulting in %5C escape codes in the url. Think it's caused by using a file path method on a url segment. Something as
might also do the trick. It leaves the Clean() in place but flips the slashes back into url mode. Maybe it needs to be changed on some more spots in the code. |
@wvdvegt Sounds reasonable. Thanks for the investigation so far. Thanks! |
Hi,
I think i managed to create a pull request (not fluent in that part of git).
Change is only one line in Packagist.go.
The issue is caused by using the filepath.Clean() method that is meant for filenames and not for URLs (so it uses the operating systems path separator and not the / URL segment separator.
Under Linux/OSX both are ‘/’ (so the error does not ‘occur’) but in Windows it’s a ‘\’ (although Windows accepts both ‘\’ and ‘/’ in filenames) causing it to be HTML encoded and Packagist to return 4XX responses.
Best
Wim van der Vegt
From: Andy Grunwald
Sent: zondag 27 september 2020 13:45
To: andygrunwald/perseus
Cc: wvdvegt; Mention
Subject: Re: [andygrunwald/perseus] Add command fails on windows (#6)
@wvdvegt Sounds reasonable. Thanks for the investigation so far.
Would you be open to create a Pull Request with the adjustments?
Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
When I try to add twig using
perseus add "twig/twig"
I get a warning
Failed to retrieve information about package "twig/twig" from Packagist. Called https://packagist.org/packages%5Ctwig%5Ctwig.json. Error: Expected a return code within 2xx for package "twig/twig". Got 404
It seems that the %5C escapes are not accepted by packagist anymore as
https://packagist.org/packages%5Ctwig%5Ctwig.json
returns the requested json
Expected Behavior
Should just work
Current Behavior
Fails to retrieve the package description.
Possible Solution
Steps to Reproduce (for bugs)
Context
Your Environment
perseus version
):The text was updated successfully, but these errors were encountered: