dotenv-vault
dotenv-vault copied to clipboard
detect package manager and offer commands using the correct one
I'm using Yarn, which, since v2, offers yarn dlx
as an equivalent of npx
. The scripts and VS Code plugin should recognise the package manager in use and format commands to use the correct one.
Not sure how to go about this. @mnbf9rca, any ideas?
I haven’t looked in detail but perhaps these have pointers to which api exposes the information?
https://github.com/microsoft/vscode-eslint/pull/1646 https://github.com/prettier/prettier-vscode/pull/1700
On Sat, 4 Nov 2023 at 06:26, Mot @.***> wrote:
Not sure how to go about this. @mnbf9rca https://github.com/mnbf9rca, any ideas?
— Reply to this email directly, view it on GitHub https://github.com/dotenv-org/dotenv-vault/issues/215#issuecomment-1793359013, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH5VUULXDZ4ABUYDKEB2MLYCXNYFAVCNFSM6AAAAAATPPHY6OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTGM2TSMBRGM . You are receiving this because you were mentioned.Message ID: @.***>
@motdotla I know of two ways:
- The antfu/ni package does this by checking the lock file's presence (
yarn.lock
for yarn,pnpm-lock.yaml
for pnpm andpackage-lock.json
for npm.) - I created a small task runner that checks the
packageManager
field in package.json since I am using corepack.