Skip to content
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

Option to enable corepack #651

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat: remove package manager name check as it will be done by corepac…
…k anyway
  • Loading branch information
SayakMukhopadhyay committed Jan 17, 2023
commit 0565a4fc0ab12102206331c8d8896b6ef4624ff9
5 changes: 0 additions & 5 deletions src/installer.ts
Original file line number Diff line number Diff line change
@@ -611,11 +611,6 @@ export async function enableCorepack(input: string): Promise<void> {
if (input.length > 0 && input !== 'false') {
Copy link
Contributor

Choose a reason for hiding this comment

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

It is enough to check if (input.length && input !== 'false')

if (input !== 'true') {
const packageManagers = input.split(' ');
if (!packageManagers.every(pm => ['npm', 'yarn', 'pnpm'].includes(pm))) {
throw new Error(
`One or more of the specified package managers [ ${input} ] are not supported by corepack`
);
}
corepackArgs.push(...packageManagers);
}
await exec.getExecOutput('corepack', corepackArgs, {
Copy link
Contributor

Choose a reason for hiding this comment

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

please, use getCommandOutput or getCommandOutputNotEmpty instead of directly calling exec.getExecOutput