mirror of
https://github.com/pnpm/pnpm.git
synced 2026-01-19 12:28:44 -05:00
fix: support --help and -h flags for 'pnpm create' command (#9624)
close #8545
This commit is contained in:
6
.changeset/icy-steaks-call.md
Normal file
6
.changeset/icy-steaks-call.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/plugin-commands-script-runners": patch
|
||||
pnpm: patch
|
||||
---
|
||||
|
||||
Fix the `--help` and `-h` flags not working as expected for the `pnpm create` command.
|
||||
@@ -7,7 +7,12 @@ import * as dlx from './dlx'
|
||||
|
||||
export const commandNames = ['create']
|
||||
|
||||
export async function handler (_opts: dlx.DlxCommandOptions, params: string[]): Promise<{ exitCode: number }> {
|
||||
export async function handler (_opts: dlx.DlxCommandOptions, params: string[]): Promise<{ exitCode: number } | string> {
|
||||
// If the first argument is --help or -h, we show the help message.
|
||||
if (params[0] === '--help' || params[0] === '-h') {
|
||||
return help()
|
||||
}
|
||||
|
||||
const [packageName, ...packageArgs] = params
|
||||
if (packageName === undefined) {
|
||||
throw new PnpmError(
|
||||
|
||||
Reference in New Issue
Block a user