-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement package manager selection dropdown
- Added a dropdown for users to select their preferred package manager. ISSUES CLOSED: #10
- Loading branch information
1 parent
bd91587
commit ff176fe
Showing
4 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const PACKAGE_MANGERS = ['npm', 'yarn', 'pnpm', 'bun'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Constants | ||
import { PACKAGE_MANGERS } from '@/constants/package-mangers' | ||
|
||
// Third-Party libraries | ||
import inquirer from 'inquirer' | ||
|
||
export async function getPackageManger(): Promise<string> { | ||
try { | ||
const { packageManager } = await inquirer.prompt({ | ||
type: 'rawlist', | ||
choices: PACKAGE_MANGERS, | ||
message: 'Which package manager do you wanna use?', | ||
name: 'packageManager' | ||
}) | ||
|
||
return packageManager | ||
} catch (error) { | ||
console.error(error) | ||
throw new Error('Something went wrong, try again later.') | ||
} | ||
} |