Skip to content

Commit

Permalink
Remove NODE_ENV check
Browse files Browse the repository at this point in the history
Motivation: tj#1955
  • Loading branch information
aweebit committed Aug 11, 2023
1 parent 8ca1459 commit c958d2b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ const { suggestSimilar } = require('./suggestSimilar');

// @ts-check

const PRODUCTION = process.env.NODE_ENV === 'production';

class Command extends EventEmitter {
/**
* Initialize a new `Command`.
Expand Down Expand Up @@ -905,7 +903,7 @@ Expecting one of '${allowedValues.join("', '")}'`);

_parseSubroutine(async, userArgsCallback, argv, parseOptions) {
const methodName = async ? 'parseAsync' : 'parse';
if (!PRODUCTION && this.parent) {
if (this.parent) {
console.warn(`Called .${methodName}() on subcommand '${this._name}'.
Call on top-level command instead`);
}
Expand Down Expand Up @@ -934,7 +932,7 @@ Call on top-level command instead`);
parse(argv, parseOptions) {
return this._parseSubroutine(false, (userArgs) => {
const result = this._parseCommand([], userArgs);
if (!PRODUCTION && isThenable(result)) {
if (isThenable(result)) {
console.warn(`.parse() is incompatible with async hooks and actions.
Use .parseAsync() instead.`);
}
Expand Down

0 comments on commit c958d2b

Please sign in to comment.