-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: check pm with a version number #6
base: master
Are you sure you want to change the base?
Conversation
Does this look good ?? Let me know if there are any changes. |
if (wantedPM !== 'npm' && wantedPM !== 'pnpm' && wantedPM !== 'yarn') { | ||
console.log(`"${wantedPM}" is not a valid package manager. Available package managers are: npm, pnpm, or yarn.`) | ||
process.exit(1) | ||
} | ||
const usedPM = whichPMRuns() | ||
if (usedPM && usedPM.name !== wantedPM) { | ||
if (usedPM && usedPM.name !== wantedPM && usedPM.version !== wantedVersion) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about when the version is not specified? In that case it shouldn't be checked, right?
if (usedPM && usedPM.name !== wantedPM && usedPM.version !== wantedVersion) { | |
if (usedPM && (usedPM.name !== wantedPM || wantedVersion && usedPM.version !== wantedVersion)) { |
Not sure if we need this feature as I know that pnpm, for instance, may verify its own version, using the engines field in |
@zkochan Though the engine field can verify its own version, the |
+1
Exactly! |
No description provided.