From ad162f273d72bedcb411a739e8417ca251ba046d Mon Sep 17 00:00:00 2001 From: Thomas Boop <52323235+thboop@users.noreply.github.com> Date: Thu, 16 Jul 2020 11:51:00 -0400 Subject: [PATCH] Fix Issue where we can no longer create zip files on windows during cli tests. (#520) * Try using pwsh instead of powershell * Fallback to powershell * Format files correctly --- __tests__/tool-cache.test.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/__tests__/tool-cache.test.ts b/__tests__/tool-cache.test.ts index 3722d18..d03c9b3 100644 --- a/__tests__/tool-cache.test.ts +++ b/__tests__/tool-cache.test.ts @@ -553,7 +553,9 @@ describe('@actions/tool-cache', function() { if (IS_WINDOWS) { const escapedStagingPath = stagingDir.replace(/'/g, "''") // double-up single quotes const escapedZipFile = zipFile.replace(/'/g, "''") - const powershellPath = await io.which('powershell', true) + const powershellPath = + (await io.which('pwsh', false)) || + (await io.which('powershell', true)) const args = [ '-NoLogo', '-Sta', @@ -604,7 +606,9 @@ describe('@actions/tool-cache', function() { if (IS_WINDOWS) { const escapedStagingPath = stagingDir.replace(/'/g, "''") // double-up single quotes const escapedZipFile = zipFile.replace(/'/g, "''") - const powershellPath = await io.which('powershell', true) + const powershellPath = + (await io.which('pwsh', false)) || + (await io.which('powershell', true)) const args = [ '-NoLogo', '-Sta', @@ -661,7 +665,9 @@ describe('@actions/tool-cache', function() { if (IS_WINDOWS) { const escapedStagingPath = stagingDir.replace(/'/g, "''") // double-up single quotes const escapedZipFile = zipFile.replace(/'/g, "''") - const powershellPath = await io.which('powershell', true) + const powershellPath = + (await io.which('pwsh', false)) || + (await io.which('powershell', true)) const args = [ '-NoLogo', '-Sta',