Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion packages/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ async function resolveTarball(pm: PackMethod, p: string, pJson: PackageJson) {
if (pm === "yarn") {
cmd += ` --filename ${filename}`;
} else if (pm === "bun") {
cmd = `bun pm pack --filename ${filename}`;
cmd = `bun pm pack --quiet --filename ${filename}`;
}
const { stdout } = await ezSpawn.async(cmd, {
stdio: "overlapped",
Expand All @@ -687,6 +687,19 @@ async function resolveTarball(pm: PackMethod, p: string, pJson: PackageJson) {
if (pm !== "yarn" && pm !== "bun") {
filename = lines[lines.length - 1].trim();
}
if (pm === "bun") {
const tgzFiles = fsSync
.readdirSync(p)
.filter((file) => file.endsWith(".tgz"));
const bunFilename = stdout.trim();
if (bunFilename) {
filename = bunFilename;
}
console.warn(`[bun pack] stdout:\n${stdout}`);
console.warn(
`[bun pack] expected filename: ${filename}; tgz files: ${tgzFiles.join(", ") || "(none)"}`,
);
}

const shasum = createHash("sha1")
.update(await fs.readFile(path.resolve(p, filename)))
Expand Down
Loading