Fix windows .exe

This commit is contained in:
Ashcon Partovi 2023-11-17 13:41:56 -08:00
parent b9cca7bdaa
commit 1f21ee1ce7
2 changed files with 6 additions and 3 deletions

2
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

View file

@ -47,9 +47,12 @@ export default async (options: Input): Promise<Output> => {
} }
} }
addPath(binPath); addPath(binPath);
const bunPath = join(binPath, "bun");
const exe = (name: string) =>
process.platform === "win32" ? `${name}.exe` : name;
const bunPath = join(binPath, exe("bun"));
try { try {
symlinkSync(bunPath, join(binPath, "bunx")); symlinkSync(bunPath, join(binPath, exe("bunx")));
} catch (error) { } catch (error) {
if (error.code !== "EEXIST") { if (error.code !== "EEXIST") {
throw error; throw error;