Skip to content

Commit b1f4bf6

Browse files
authored
add bun package manager option (stack-auth#174)
1 parent c182ceb commit b1f4bf6

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

packages/init-stack/index.mjs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ const commandsExecuted = [];
4848
async function main() {
4949
console.log();
5050
console.log(`
51-
██████
52-
██████████████
53-
████████████████████
51+
██████
52+
██████████████
53+
████████████████████
5454
████████████████████ WELCOME TO
5555
█████████████████ ╔═╗╔╦╗╔═╗╔═╗╦╔═ ┌─┐┬ ┬┌┬┐┬ ┬
5656
█████████████ ╚═╗ ║ ╠═╣║ ╠╩╗ ├─┤│ │ │ ├─┤
5757
█████████████ ████ ╚═╝ ╩ ╩ ╩╚═╝╩ ╩ ┴ ┴└─┘ ┴ ┴ ┴
58-
█████████████████
59-
██████ ██
60-
████ ████
58+
█████████████████
59+
██████ ██
60+
████ ████
6161
█████ █████
6262
██████
6363
`);
@@ -432,21 +432,24 @@ async function getPackageManager() {
432432
const yarnLock = fs.existsSync(path.join(projectPath, "yarn.lock"));
433433
const pnpmLock = fs.existsSync(path.join(projectPath, "pnpm-lock.yaml"));
434434
const npmLock = fs.existsSync(path.join(projectPath, "package-lock.json"));
435+
const bunLock = fs.existsSync(path.join(projectPath, "bun.lockb"));
435436

436-
if (yarnLock && !pnpmLock && !npmLock) {
437+
if (yarnLock && !pnpmLock && !npmLock && !bunLock) {
437438
return "yarn";
438-
} else if (!yarnLock && pnpmLock && !npmLock) {
439+
} else if (!yarnLock && pnpmLock && !npmLock && !bunLock) {
439440
return "pnpm";
440-
} else if (!yarnLock && !pnpmLock && npmLock) {
441+
} else if (!yarnLock && !pnpmLock && npmLock && !bunLock) {
441442
return "npm";
443+
} else if (!yarnLock && !pnpmLock && !npmLock && bunLock) {
444+
return "bun";
442445
}
443446

444447
const answers = await inquirer.prompt([
445448
{
446449
type: "list",
447450
name: "packageManager",
448451
message: "Which package manager are you using for this project?",
449-
choices: ["npm", "yarn", "pnpm"],
452+
choices: ["npm", "yarn", "pnpm", "bun"],
450453
},
451454
]);
452455
return answers.packageManager;

0 commit comments

Comments
 (0)