From 67e559db2c8666d0d4455009db7c5ab6378e550f Mon Sep 17 00:00:00 2001 From: Nilesh Suthar Date: Thu, 7 Sep 2023 23:16:23 +0530 Subject: [PATCH] fix: use copy instead of mv (#15) * fix: use copy instead of mv * fix: path does not exist --- dist/setup.js | 6 ++++-- src/setup.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dist/setup.js b/dist/setup.js index 1c543ee..3be1eb3 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, mkdirP, rmRF } from "@actions/io"; import { getExecOutput } from "@actions/exec"; export default async (options) => { const { url, cacheKey } = getDownloadUrl(options); @@ -33,7 +33,9 @@ export default async (options) => { const zipPath = await downloadTool(url); const extractedPath = await extractZip(zipPath); const exePath = await extractBun(extractedPath); - await mv(exePath, path); + await mkdirP(dir); + await cp(exePath, path); + await rmRF(exePath); version = await verifyBun(path); } if (!version) { diff --git a/src/setup.ts b/src/setup.ts index 2880c77..435ed9e 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, mkdirP, rmRF } from "@actions/io"; import { getExecOutput } from "@actions/exec"; export default async (options?: { @@ -41,7 +41,9 @@ export default async (options?: { const zipPath = await downloadTool(url); const extractedPath = await extractZip(zipPath); const exePath = await extractBun(extractedPath); - await mv(exePath, path); + await mkdirP(dir); + await cp(exePath, path); + await rmRF(exePath); version = await verifyBun(path); } if (!version) {