-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix extractTar on Windows #264
Conversation
@@ -268,96 +268,88 @@ describe('@actions/tool-cache', function() { | |||
await io.rmRF(tempDir) |
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.
i had to recreate test.tar.gz with the option --format pax
otherwise bsdtar doesnt preserve UTF file names correctly
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.
i added a README.txt to the archive for future reference
|
||
await io.mkdirP(tempDir) | ||
it('extract .tar.gz', async () => { |
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.
no changes here, just eliminated the else
condition and de-indented
let destArg = dest | ||
if (IS_WINDOWS && isGnuTar) { | ||
args.push('--force-local') | ||
destArg = dest.replace(/\\/g, '/') |
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.
Both destArg
and file
need the \
replacement
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.
I can add for file too, but when i tested file
doesnt appear to be required
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.
i'll push this change, aesthetically it will look good for consistency
Co-Authored-By: Josh Gross <joshmgross@github.com>
Add a description for the PR ☝️ |
Other than description, LGTM |
stderr: (data: Buffer) => (versionOutput += data.toString()) | ||
} | ||
}) | ||
const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR') |
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.
Consider debugging this so we can troubleshoot easier if for some reason this breaks. (Analyzing text output of a cli can be a little fragile)
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.
the output flows to the console too, so we're good wrt that aspect
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.
LGTM minor thoughts
Fixes extractTar on Windows by formatting the arguments different depending on whether BSD tar or GNU tar is being called.