From 8463dee03837ae5beaa652b88c09ab68f3e17879 Mon Sep 17 00:00:00 2001 From: xHyroM Date: Mon, 11 Jul 2022 10:10:16 +0200 Subject: [PATCH] fix: path --- dist/utils/install.js | 7 ++++--- src/utils/install.ts | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dist/utils/install.js b/dist/utils/install.js index 7a81bc2..2c2a4d7 100644 --- a/dist/utils/install.js +++ b/dist/utils/install.js @@ -1,6 +1,7 @@ import { cacheDir, downloadTool, extractZip, find } from '@actions/tool-cache'; import { addPath, info } from '@actions/core'; import getAsset from './getAsset.js'; +import getHomeDir from './getHomeDir.js'; import { join } from 'path'; export default async (release) => { const cache = find('bun', release.tag_name); @@ -12,11 +13,11 @@ export default async (release) => { const asset = getAsset(release.assets); info(`Downloading Bun from ${asset.browser_download_url}.`); const zipPath = await downloadTool(asset.browser_download_url); - const extracted = await extractZip(zipPath); + const extracted = await extractZip(zipPath, join(getHomeDir(), ".bun", "bin")); const newCache = await cacheDir(extracted, 'bun', release.tag_name); info(`Cached Bun to ${newCache}.`); addPath(newCache); - info(extracted); - const bunPath = join(extracted); + console.log(extracted); + const bunPath = join(getHomeDir(), ".bun", "bin"); addPath(bunPath); }; diff --git a/src/utils/install.ts b/src/utils/install.ts index 1af7246..9cf123d 100644 --- a/src/utils/install.ts +++ b/src/utils/install.ts @@ -18,7 +18,7 @@ export default async(release: Release) => { info(`Downloading Bun from ${asset.browser_download_url}.`); const zipPath = await downloadTool(asset.browser_download_url); - const extracted = await extractZip(zipPath); + const extracted = await extractZip(zipPath, join(getHomeDir(), ".bun", "bin")); const newCache = await cacheDir( extracted, @@ -29,7 +29,7 @@ export default async(release: Release) => { info(`Cached Bun to ${newCache}.`); addPath(newCache); - info(extracted); - const bunPath = join(extracted); + console.log(extracted); + const bunPath = join(getHomeDir(), ".bun", "bin"); addPath(bunPath); } \ No newline at end of file