1
0
Fork 0
mirror of https://github.com/actions/toolkit synced 2025-05-09 08:33:00 +00:00

Fix gnutar check on windows

This commit is contained in:
Sampark Sharma 2022-11-07 13:43:54 +00:00 committed by GitHub
parent 9366237c90
commit 0c58e4113e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -117,8 +117,9 @@ export function getCacheFileName(compressionMethod: CompressionMethod): string {
}
export async function isGnuTarInstalled(): Promise<boolean> {
const gnuTar = `${process.env['windir']}\\Program Files\\Git\\usr\\bin\\tar.exe`
const versionOutput = await getVersion('tar')
return versionOutput.toLowerCase().includes('gnu tar')
return versionOutput.toLowerCase().includes('gnu tar') || fs.existsSync(gnuTar)
}
export function assertDefined<T>(name: string, value?: T): T {

View file

@ -15,7 +15,7 @@ async function getTarPath(
case 'win32': {
const systemTar = `${process.env['windir']}\\System32\\tar.exe`
const gnuTar = `${process.env['windir']}\\Program Files\\Git\\usr\\bin\\tar.exe`
if (compressionMethod !== CompressionMethod.Gzip && existsSync(gnuTar)) {
if (existsSync(gnuTar)) {
args.push('--force-local')
return gnuTar
} else if (compressionMethod !== CompressionMethod.Gzip) {