Skip to content

Commit 997a447

Browse files
authored
feat(cli): support bun package manager (#606)
When installing prettier plugins, use `bun` package manager if project uses it (https://bun.sh/).
1 parent 34f6d85 commit 997a447

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.changeset/calm-mugs-cheat.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"lingo.dev": patch
3+
---
4+
5+
support bun package manager

packages/cli/src/cli/loaders/prettier.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,19 @@ async function installDependencies() {
8383
// determine if yarn or pnpm is used based on lockfile, otherwise use npm
8484
async function getPackageManager() {
8585
const yarnLockfile = path.resolve(process.cwd(), "yarn.lock");
86-
const pnpmLockfile = path.resolve(process.cwd(), "pnpm-lock.yaml");
8786
if (fs.existsSync(yarnLockfile)) {
8887
return "yarn";
8988
}
89+
90+
const pnpmLockfile = path.resolve(process.cwd(), "pnpm-lock.yaml");
9091
if (fs.existsSync(pnpmLockfile)) {
9192
return "pnpm";
9293
}
94+
95+
const bunLockfile = path.resolve(process.cwd(), "bun.lock");
96+
if (fs.existsSync(bunLockfile)) {
97+
return "bun";
98+
}
99+
93100
return "npm";
94101
}

0 commit comments

Comments
 (0)