diff --git a/CHANGELOG.md b/CHANGELOG.md index 702fded3100..9e2248731e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,2 @@ - Added default value for `emulators.dataconnect.dataDir` to `init dataconnect`. +- Fixed an issue where `firebase` would error out instead of displaying help text. diff --git a/src/bin/firebase.ts b/src/bin/firebase.ts index 631eb54ee73..0d8d4d1b976 100755 --- a/src/bin/firebase.ts +++ b/src/bin/firebase.ts @@ -33,7 +33,7 @@ import * as fsutils from "../fsutils"; import * as utils from "../utils"; import * as winston from "winston"; -let args = process.argv.slice(2); +const args = process.argv.slice(2); let cmd: CommanderStatic; function findAvailableLogFile(): string { @@ -161,11 +161,10 @@ process.on("uncaughtException", (err) => { }); if (!handlePreviewToggles(args)) { - cmd = client.cli.parse(process.argv); - - // determine if there are any non-option arguments. if not, display help - args = args.filter((arg) => !arg.includes("-")); + // determine if there are any arguments. if not, display help if (!args.length) { client.cli.help(); + } else { + cmd = client.cli.parse(process.argv); } }