mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-17 20:18:24 +02:00
Actually fix double zip issue
This commit is contained in:
parent
a730821cf4
commit
15050a7632
2 changed files with 23 additions and 18 deletions
18
dist/setup.js
vendored
18
dist/setup.js
vendored
|
@ -74,14 +74,18 @@ function getDownloadUrl(options) {
|
|||
}
|
||||
async function extractBun(path) {
|
||||
for (const entry of await readdir(path, { withFileTypes: true })) {
|
||||
const entryPath = join(path, entry.name);
|
||||
action.debug(`Looking: ${entryPath}`);
|
||||
if (entry.name === "bun" && entry.isFile()) {
|
||||
action.debug(`Found: ${entryPath}`);
|
||||
return entryPath;
|
||||
const { name } = entry;
|
||||
const entryPath = join(path, name);
|
||||
if (entry.isFile()) {
|
||||
if (name === "bun") {
|
||||
return entryPath;
|
||||
}
|
||||
if (/^bun.*\.zip/.test(name)) {
|
||||
const extractedPath = await extractZip(entryPath);
|
||||
return extractBun(extractedPath);
|
||||
}
|
||||
}
|
||||
if (entry.name.startsWith("bun") && entry.isDirectory()) {
|
||||
action.debug(`Continue looking: ${entryPath}`);
|
||||
if (/^bun/.test(name) && entry.isDirectory()) {
|
||||
return extractBun(entryPath);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue