Is it possible to run post upgrade script depending on the type of package manager? #8857
-
My requirement is to run So per the docs, I should use postUpgradeTasks: {
commands: ["is_npm && npm audit fix",
"is_yarn && npx yarn-audit-fix",
"is_pnpm && pnpm update --depth Infinity", // https://github.com/pnpm/pnpm/issues/1153#issuecomment-725440377
],
fileFilters: ["package-lock.json", "yarn.lock", "pnpm-lock.yaml"],
}, But I need to know the type of package manager. How? Side question: is there a way to change npm's version depending on which version of The main reason I'm doing this is because #3080 is not supported yet. I need Any suggestions? Thank you so much! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
#3080 will be fixed soon. |
Beta Was this translation helpful? Give feedback.
-
We don't currently distinguish between npm and yarn - they are considered the same |
Beta Was this translation helpful? Give feedback.
We don't currently distinguish between npm and yarn - they are considered the same
manager
. So both are language=javascript and manager=npm. You may be able to distinguish between them using"matchFiles": ["package-lock.json"]
and"matchFiles": ["yarn.lock"]
becausematchFiles
can be either package file or the lock file.