Open slorber opened 3 years ago
This package assumes yarn.lock is in cwd folder, which is not always the case for Yarn workspaces, and result will depend on how you run the command:
yarn.lock
cwd
yarn workspace my-package xyz
hasYarn=true
cd packages/my-package && yarn xyz
hasYarn=false
I suggest to also look for a Yarn workspace in parent folders, and look for a lock file there too
This is especially true for Yarn 3 where there is only a single yarn.lock file at the root of the monorepo.
This package assumes
yarn.lock
is incwd
folder, which is not always the case for Yarn workspaces, and result will depend on how you run the command:yarn workspace my-package xyz
=>hasYarn=true
cd packages/my-package && yarn xyz
=>hasYarn=false
I suggest to also look for a Yarn workspace in parent folders, and look for a lock file there too