mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-08-17 10:16:01 +08:00
Fix GNUtar path
This commit is contained in:
parent
62a66a8ce9
commit
e0aadb573c
2
packages/cache/src/internal/cacheUtils.ts
vendored
2
packages/cache/src/internal/cacheUtils.ts
vendored
@ -117,7 +117,7 @@ export function getCacheFileName(compressionMethod: CompressionMethod): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function isGnuTarInstalled(): Promise<boolean> {
|
export async function isGnuTarInstalled(): Promise<boolean> {
|
||||||
const gnuTar = `${process.env['windir']}\\Program Files\\Git\\usr\\bin\\tar.exe`
|
const gnuTar = `${process.env['PROGRAMFILES']}\\Git\\usr\\bin\\tar.exe`
|
||||||
const versionOutput = await getVersion('tar')
|
const versionOutput = await getVersion('tar')
|
||||||
return (
|
return (
|
||||||
versionOutput.toLowerCase().includes('gnu tar') || fs.existsSync(gnuTar)
|
versionOutput.toLowerCase().includes('gnu tar') || fs.existsSync(gnuTar)
|
||||||
|
2
packages/cache/src/internal/tar.ts
vendored
2
packages/cache/src/internal/tar.ts
vendored
@ -14,7 +14,7 @@ async function getTarPath(
|
|||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case 'win32': {
|
case 'win32': {
|
||||||
const systemTar = `${process.env['windir']}\\System32\\tar.exe`
|
const systemTar = `${process.env['windir']}\\System32\\tar.exe`
|
||||||
const gnuTar = `${process.env['windir']}\\Program Files\\Git\\usr\\bin\\tar.exe`
|
const gnuTar = `${process.env['PROGRAMFILES']}\\Git\\usr\\bin\\tar.exe`
|
||||||
if (existsSync(gnuTar)) {
|
if (existsSync(gnuTar)) {
|
||||||
// Making GNUtar + zstd as default on windows
|
// Making GNUtar + zstd as default on windows
|
||||||
args.push('--force-local')
|
args.push('--force-local')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user