-
Notifications
You must be signed in to change notification settings - Fork 904
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
Ability to use Get-ChocolateyUnzip with "Extract"[e] instead of "eXtract with full paths"[x] -- 7z (cmd) #1824
Comments
Not sure I follow all of this. Extract with full paths basically ensures the file structure of what is zipped up. If you wanted it without file structure, why not put it into the zip that way? |
Problem is that not me is doing that, this is how the package is set up by Upstream if you want to call it that. For example I'm creating SW package based on 3 components:
Because the Install-ChocolateyZipPackage currently uses Get-ChocolateyUnzip which in place uses hardcoded 7zip command from which only E.g.: $params = "x -aoa -bd -bb1 -o`"$destinationNoRedirection`" -y `"$fileFullPathNoRedirection`"" IMO it could beneficial if there is a way to "flat-out" some zipped content so that user could do that. Currently I need to do workaround for this like:
|
You can run "&$ENV:ChocolateyInstall\tools\7z.exe e ZIPFILE" |
@bcurran3 that is not considered part of the public API. So it's likely we will move those things and it will break packages using these internal things. In other words, please refrain from assuming these things will be here, and absolutely do not use them directly. |
So it sounds like we need to expose a flatten parameter? |
@n3rd4i - you can also use 7zip.commandline as a dependency to solve this problem. (The shim will make you happy.) Using my previous method, you'd want to put a dependency of chocolatey and limit it's version through the current beta to be safe. @ferventcoder - I understand that things (Chocolatey install method) could change...
|
This is the API - https://chocolatey.org/docs/helpers-reference. If you don't see it here, don't use it as it is not part of the published API. |
Basically the only contracts for Chocolatey provided things that change slowly and with long term compatibility are the Chocolatey functions, unless a function specifically states it is not part of the public API and should not be used directly (as you pointed out). |
Not at this time, but you wouldn't want something to break if we did. We have moved things in that area in the past and it did break things for some package authors. We warned them against it as well when we saw they were doing it. Just to remind myself to keep folks on the right track, I've added this chocolatey/package-validator#189. Better to know right off you are not following a best practice and stick to what's available - and request for enhancements here, like @n3rd4i has done.
I definitely like this aspect, as it is more flexible until Chocolatey can support it. |
Just an FYI, do not use the |
Current situation when using
Get-ChocolateyUnzip
the 7z command that gets executed is "x":7z.exe x
which means "eXtract with full paths"Ability to change this to "e" could be beneficial for download/zip files which contain folders and only files (not folders) from the archive are needed, example:
7z.exe e
which means "Extract"I could not find workaround this issue.
One could try to use move commands after unzip but that defeats the intended functionality?
The text was updated successfully, but these errors were encountered: