feat!: "pnpm r" is not an alias of "pnpm remove"

ref #2329
This commit is contained in:
Zoltan Kochan
2020-04-29 23:00:48 +03:00
committed by Zoltan Kochan
parent 2e8ebabb20
commit 9e2a5b827e
3 changed files with 9 additions and 10 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/plugin-commands-installation": major
"pnpm": major
---
`pnpm r` is not an alias of `pnpm remove`.

View File

@@ -118,7 +118,9 @@ export function help () {
})
}
export const commandNames = ['remove', 'uninstall', 'r', 'rm', 'un']
// Unlike npm, pnpm does not treat "r" as an alias of "remove".
// This way we avoid the confusion about whether "pnpm r" means remove, run, or recursive.
export const commandNames = ['remove', 'uninstall', 'rm', 'un']
export const completion: CompletionFunc = (cliOpts, params) => {
return readDepNameCompletions(cliOpts.dir as string)

View File

@@ -87,15 +87,6 @@ export default async function run (inputArgv: string[]) {
process.env['FORCE_COLOR'] = '0'
}
if (config.useBetaCli && cmd === 'remove' && config.argv.remain[0] === 'r') {
// Reporting is not initialized at this point, so just printing the error
console.error(`${chalk.bgRed.black('\u2009ERROR\u2009')} ${
chalk.red("The 'r' alias for 'pnpm remove' is deprecated.")}`)
console.log(`For help, run: pnpm help ${cmd}`)
process.exit(1)
return
}
const selfUpdate = config.global && (cmd === 'add' || cmd === 'update') && cliParams.includes(packageManager.name)
// Don't check for updates