mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-18 04:28:28 +02:00
Add symlink for bunx
This commit is contained in:
parent
67e559db2c
commit
b5e3caf47a
1 changed files with 8 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
import { homedir } from "node:os";
|
import { homedir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import { readdir } from "node:fs/promises";
|
import { readdir, symlink } from "node:fs/promises";
|
||||||
import * as action from "@actions/core";
|
import * as action from "@actions/core";
|
||||||
import { downloadTool, extractZip } from "@actions/tool-cache";
|
import { downloadTool, extractZip } from "@actions/tool-cache";
|
||||||
import * as cache from "@actions/cache";
|
import * as cache from "@actions/cache";
|
||||||
|
@ -51,6 +51,13 @@ export default async (options?: {
|
||||||
"Downloaded a new version of Bun, but failed to check its version? Try again in debug mode."
|
"Downloaded a new version of Bun, but failed to check its version? Try again in debug mode."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
await symlink(path, join(dir, "bunx"));
|
||||||
|
} catch (error) {
|
||||||
|
if (error.code !== "EEXIST") {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (cacheEnabled) {
|
if (cacheEnabled) {
|
||||||
try {
|
try {
|
||||||
await saveCache([path], cacheKey);
|
await saveCache([path], cacheKey);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue