Skip to content

Commit

Permalink
add warning if using npm as fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhaiwat10 committed Dec 27, 2024
1 parent 15b9eba commit 6f3b3f9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/create-fuels/src/lib/getPackageManager.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { warn } from '../utils/logger';

export const availablePackageManagers = ['pnpm', 'npm', 'bun'] as const;
export type PackageManager = (typeof availablePackageManagers)[number];

Expand Down Expand Up @@ -42,6 +44,12 @@ export function getUserPkgManager(): PackageManager {
return packageMangers.bun.name;
}

if (userAgent.startsWith(packageMangers.npm.name)) {
return packageMangers.npm.name;
}

warn(`This package manager is not supported. Using npm instead.`);

return packageMangers.npm.name;
}

Expand Down

0 comments on commit 6f3b3f9

Please sign in to comment.