From 32f15666bd7e024932ea0dcf2e9827c628ab05e9 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 --- packages/tool-cache/__tests__/tool-cache.test.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/tool-cache/__tests__/tool-cache.test.ts b/packages/tool-cache/__tests__/tool-cache.test.ts index 3722d18b..d03c9b39 100644 --- a/packages/tool-cache/__tests__/tool-cache.test.ts +++ b/packages/tool-cache/__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',