From a3cfc7af9cbc2ae6ecf83462e4f3ecaff9ad41b6 Mon Sep 17 00:00:00 2001 From: Nilesh Suthar Date: Thu, 7 Sep 2023 15:38:51 +0530 Subject: [PATCH 1/2] fix: use copy instead of mv --- dist/setup.js | 5 +++-- src/setup.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dist/setup.js b/dist/setup.js index 1c543ee9..6f163c23 100644 --- a/dist/setup.js +++ b/dist/setup.js @@ -5,7 +5,7 @@ import * as action from "@actions/core"; import { downloadTool, extractZip } from "@actions/tool-cache"; import * as cache from "@actions/cache"; import { restoreCache, saveCache } from "@actions/cache"; -import { mv } from "@actions/io"; +import { cp, rmRF } from "@actions/io"; import { getExecOutput } from "@actions/exec"; export default async (options) => { const { url, cacheKey } = getDownloadUrl(options); @@ -33,7 +33,8 @@ export default async (options) => { const zipPath = await downloadTool(url); const extractedPath = await extractZip(zipPath); const exePath = await extractBun(extractedPath); - await mv(exePath, path); + await cp(exePath, path); + await rmRF(exePath); version = await verifyBun(path); } if (!version) { diff --git a/src/setup.ts b/src/setup.ts index 2880c77e..c42e6471 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -5,7 +5,7 @@ import * as action from "@actions/core"; import { downloadTool, extractZip } from "@actions/tool-cache"; import * as cache from "@actions/cache"; import { restoreCache, saveCache } from "@actions/cache"; -import { mv } from "@actions/io"; +import { cp, rmRF } from "@actions/io"; import { getExecOutput } from "@actions/exec"; export default async (options?: { @@ -41,7 +41,8 @@ export default async (options?: { const zipPath = await downloadTool(url); const extractedPath = await extractZip(zipPath); const exePath = await extractBun(extractedPath); - await mv(exePath, path); + await cp(exePath, path); + await rmRF(exePath); version = await verifyBun(path); } if (!version) { From 9c73836de3518af3d2523b50ec6cf1a954f6e27a Mon Sep 17 00:00:00 2001 From: Nilesh Suthar Date: Thu, 7 Sep 2023 15:56:40 +0530 Subject: [PATCH 2/2] fix: path does not exist --- dist/setup.js | 3 ++- src/setup.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/setup.js b/dist/setup.js index 6f163c23..3be1eb3c 100644 --- a/dist/setup.js +++ b/dist/setup.js @@ -5,7 +5,7 @@ import * as action from "@actions/core"; import { downloadTool, extractZip } from "@actions/tool-cache"; import * as cache from "@actions/cache"; import { restoreCache, saveCache } from "@actions/cache"; -import { cp, rmRF } from "@actions/io"; +import { cp, mkdirP, rmRF } from "@actions/io"; import { getExecOutput } from "@actions/exec"; export default async (options) => { const { url, cacheKey } = getDownloadUrl(options); @@ -33,6 +33,7 @@ export default async (options) => { const zipPath = await downloadTool(url); const extractedPath = await extractZip(zipPath); const exePath = await extractBun(extractedPath); + await mkdirP(dir); await cp(exePath, path); await rmRF(exePath); version = await verifyBun(path); diff --git a/src/setup.ts b/src/setup.ts index c42e6471..435ed9e5 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -5,7 +5,7 @@ import * as action from "@actions/core"; import { downloadTool, extractZip } from "@actions/tool-cache"; import * as cache from "@actions/cache"; import { restoreCache, saveCache } from "@actions/cache"; -import { cp, rmRF } from "@actions/io"; +import { cp, mkdirP, rmRF } from "@actions/io"; import { getExecOutput } from "@actions/exec"; export default async (options?: { @@ -41,6 +41,7 @@ export default async (options?: { const zipPath = await downloadTool(url); const extractedPath = await extractZip(zipPath); const exePath = await extractBun(extractedPath); + await mkdirP(dir); await cp(exePath, path); await rmRF(exePath); version = await verifyBun(path);