mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-19 13:08:27 +02:00
chore: dont cache if customDownloadUrl
This commit is contained in:
parent
fe160cf381
commit
a11484a419
4 changed files with 15 additions and 10 deletions
|
@ -26,7 +26,7 @@ const main = async() => {
|
|||
|
||||
info(`Going to install release ${release.version}`);
|
||||
|
||||
await install(release, token);
|
||||
await install(release, token, customDownloadUrl === null);
|
||||
|
||||
setOutput('bun-version', release.tag_name);
|
||||
} catch(e) {
|
||||
|
|
|
@ -7,7 +7,7 @@ import { join } from 'path';
|
|||
import { homedir } from 'os';
|
||||
import { readdirSync } from 'fs';
|
||||
|
||||
export default async(release: Release, token: string) => {
|
||||
export default async(release: Release, token: string, customUrl: boolean) => {
|
||||
const asset = getAsset(release.assets);
|
||||
const path = join(homedir(), '.bun', 'bin', asset.name);
|
||||
const cache = find('bun', release.version) || await restoreCache([path], `bun-${process.platform}-${asset.name}-${release.version}`);
|
||||
|
@ -34,9 +34,12 @@ export default async(release: Release, token: string) => {
|
|||
'bun',
|
||||
release.version
|
||||
);
|
||||
await saveCache([
|
||||
join(extracted, asset.name)
|
||||
], `bun-${process.platform}-${asset.name}-${release.version}`);
|
||||
|
||||
if (!customUrl) {
|
||||
await saveCache([
|
||||
join(extracted, asset.name)
|
||||
], `bun-${process.platform}-${asset.name}-${release.version}`);
|
||||
}
|
||||
|
||||
info(`Cached Bun to ${newCache}.`);
|
||||
addPath(newCache);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue