mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-02-23 18:50:10 +08:00
fix: path
This commit is contained in:
parent
ec51d40f3c
commit
8463dee038
7
dist/utils/install.js
vendored
7
dist/utils/install.js
vendored
@ -1,6 +1,7 @@
|
|||||||
import { cacheDir, downloadTool, extractZip, find } from '@actions/tool-cache';
|
import { cacheDir, downloadTool, extractZip, find } from '@actions/tool-cache';
|
||||||
import { addPath, info } from '@actions/core';
|
import { addPath, info } from '@actions/core';
|
||||||
import getAsset from './getAsset.js';
|
import getAsset from './getAsset.js';
|
||||||
|
import getHomeDir from './getHomeDir.js';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
export default async (release) => {
|
export default async (release) => {
|
||||||
const cache = find('bun', release.tag_name);
|
const cache = find('bun', release.tag_name);
|
||||||
@ -12,11 +13,11 @@ export default async (release) => {
|
|||||||
const asset = getAsset(release.assets);
|
const asset = getAsset(release.assets);
|
||||||
info(`Downloading Bun from ${asset.browser_download_url}.`);
|
info(`Downloading Bun from ${asset.browser_download_url}.`);
|
||||||
const zipPath = await downloadTool(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);
|
const newCache = await cacheDir(extracted, 'bun', release.tag_name);
|
||||||
info(`Cached Bun to ${newCache}.`);
|
info(`Cached Bun to ${newCache}.`);
|
||||||
addPath(newCache);
|
addPath(newCache);
|
||||||
info(extracted);
|
console.log(extracted);
|
||||||
const bunPath = join(extracted);
|
const bunPath = join(getHomeDir(), ".bun", "bin");
|
||||||
addPath(bunPath);
|
addPath(bunPath);
|
||||||
};
|
};
|
||||||
|
@ -18,7 +18,7 @@ export default async(release: Release) => {
|
|||||||
info(`Downloading Bun from ${asset.browser_download_url}.`);
|
info(`Downloading Bun from ${asset.browser_download_url}.`);
|
||||||
|
|
||||||
const zipPath = await downloadTool(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(
|
const newCache = await cacheDir(
|
||||||
extracted,
|
extracted,
|
||||||
@ -29,7 +29,7 @@ export default async(release: Release) => {
|
|||||||
info(`Cached Bun to ${newCache}.`);
|
info(`Cached Bun to ${newCache}.`);
|
||||||
addPath(newCache);
|
addPath(newCache);
|
||||||
|
|
||||||
info(extracted);
|
console.log(extracted);
|
||||||
const bunPath = join(extracted);
|
const bunPath = join(getHomeDir(), ".bun", "bin");
|
||||||
addPath(bunPath);
|
addPath(bunPath);
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user