mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-01 18:23:16 +08:00
Check if tool path exists before executing (#385)
This commit is contained in:
@@ -279,7 +279,7 @@ async function extractZipWin(file: string, dest: string): Promise<void> {
|
||||
const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`
|
||||
|
||||
// run powershell
|
||||
const powershellPath = await io.which('powershell')
|
||||
const powershellPath = await io.which('powershell', true)
|
||||
const args = [
|
||||
'-NoLogo',
|
||||
'-Sta',
|
||||
@@ -294,7 +294,7 @@ async function extractZipWin(file: string, dest: string): Promise<void> {
|
||||
}
|
||||
|
||||
async function extractZipNix(file: string, dest: string): Promise<void> {
|
||||
const unzipPath = await io.which('unzip')
|
||||
const unzipPath = await io.which('unzip', true)
|
||||
await exec(`"${unzipPath}"`, [file], {cwd: dest})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user