Skip to content

Commit

Permalink
Throw error if no package manager is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
codykaup committed Oct 3, 2024
1 parent e4716ca commit b1f68c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions node-src/lib/getPackageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export const getPackageManagerRunCommand = async (args: string[]) => {

// e.g. `8.19.2`
export const getPackageManagerVersion = async (packageManager: string) => {
if (!packageManager) {
throw new Error('No package manager provided');
}

const { stdout } = await execa(packageManager, ['--version']);
const [output] = (stdout.toString() as string).trim().split('\n', 1);
return output.trim().replace(/^v/, '');
Expand Down

0 comments on commit b1f68c5

Please sign in to comment.