-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[Utility] Added option to select 7z level of compression. #7058
Conversation
5bcd0bd
to
5f63ebe
Compare
@alexwiese thanks for this great contribution! Nice work. Two thoughts:
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(system.defaultWorkingDirectory)'
archiveType: 7z
sevenZipCompression: maximum Instead of: - task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(system.defaultWorkingDirectory)'
archiveType: 7z
sevenZipCompression: 7 |
Tasks/ArchiveFiles/archivefiles.ts
Outdated
@@ -79,6 +79,12 @@ function sevenZipArchive(archive: string, compression: string, files: string[]) | |||
var sevenZip = tl.createToolRunner(getSevenZipLocation()); | |||
sevenZip.arg('a'); | |||
sevenZip.arg('-t' + compression); | |||
|
|||
const sevenZipCompression = tl.getInput('sevenZipCompression', false); | |||
if(sevenZipCompression) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add space after if
Looks good to me, but I don't own this task. I'll let @bryanmacfarlane or @ericsciple complete the merge if they agree with adding this parameter. |
5f63ebe
to
b259644
Compare
@davidstaheli @brcrista thanks. Makes sense. Please see latest commit. |
For safety with values people type in YAML, you could call toLower() on sevenZipCompression before switching on it. |
b259644
to
3915de1
Compare
This should be ready to merge now. |
f995f0b
to
7979b90
Compare
6366e41
to
6331c24
Compare
@alexwiese sorry this slipped through the cracks! If you're still interested, I think we should take this. If you can resolve conflicts and update the task.json/task.loc.json to 2.159.0 I'll merge. |
6331c24
to
19b6f21
Compare
@damccorm done :) |
Merged! Thanks for the really quick turnaround 😃 |
Similarly to the
tarCompression
option, this change allows the user to select the level of compression for 7z files.The option names follow the naming conventions used by 7z.