Skip to content

Commit

Permalink
Revert "Handle multiple lockfiles including Bun"
Browse files Browse the repository at this point in the history
This reverts commit d1d25b6.
  • Loading branch information
Strengthless committed Sep 10, 2023
1 parent 7482db9 commit f562909
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ team.

- `--use-yarn`

By default, patch-package checks whether you use npm, yarn or bun based on
which lockfile you have. If you have multiple lockfiles, it uses npm by
default. Set this option to override that default and always use yarn.
By default, patch-package checks whether you use npm or yarn based on which
lockfile you have. If you have both, it uses npm by default. Set this option
to override that default and always use yarn.

- `--exclude <regexp>`

Expand Down
10 changes: 2 additions & 8 deletions src/detectPackageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function printSelectingDefaultMessage() {
console.info(
`${chalk.bold(
"patch-package",
)}: you have multiple lockfiles, e.g. yarn.lock and package-lock.json
)}: you have both yarn.lock and package-lock.json
Defaulting to using ${chalk.bold("npm")}
You can override this setting by passing --use-yarn or deleting
package-lock.json if you don't need it
Expand All @@ -54,13 +54,7 @@ export const detectPackageManager = (
const bunLockbExists = fs.existsSync(
join(findWorkspaceRoot() ?? appRootPath, "bun.lockb"),
)
if (
[
packageLockExists || shrinkWrapExists,
yarnLockExists,
bunLockbExists,
].filter(Boolean).length > 1
) {
if ((packageLockExists || shrinkWrapExists) && yarnLockExists) {
if (overridePackageManager) {
return overridePackageManager
} else {
Expand Down

0 comments on commit f562909

Please sign in to comment.