Skip to content

Commit

Permalink
fix: Fix automatic package detection with yarn^3 (#1886)
Browse files Browse the repository at this point in the history
  • Loading branch information
roninjin10 authored Feb 20, 2023
1 parent 0693741 commit 36e119c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/eight-vans-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@wagmi/cli': patch
---

Fixed package detection for yarn^3
4 changes: 1 addition & 3 deletions packages/cli/src/utils/packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ export async function getIsPackageInstalled({
try {
const packageManager = await getPackageManager()
const command =
packageManager === 'yarn'
? ['list', '--pattern', packageName]
: ['ls', packageName]
packageManager === 'yarn' ? ['why', packageName] : ['ls', packageName]
const { stdout } = await execa(packageManager, command, { cwd })
if (stdout !== '') return true
return false
Expand Down

1 comment on commit 36e119c

@vercel
Copy link

@vercel vercel bot commented on 36e119c Feb 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.