From fc51bcd691229946cca53ee297fd6200f13ec15d Mon Sep 17 00:00:00 2001 From: Justin Wilaby Date: Wed, 29 Jan 2025 19:18:39 -0800 Subject: [PATCH] fixed a small issue with enternig repl mode and added an exit command --- packages/cli/bin/heroku-repl.js | 4 ++++ packages/cli/bin/run | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/cli/bin/heroku-repl.js b/packages/cli/bin/heroku-repl.js index ad54935793..f9fb3c4260 100644 --- a/packages/cli/bin/heroku-repl.js +++ b/packages/cli/bin/heroku-repl.js @@ -16,6 +16,10 @@ module.exports.herokuRepl = async function (config) { for await (const input of commandGenerator()) { const [command, ...argv] = input + if (command === '.exit') { + process.exit(0) + } + if (command.startsWith('set')) { flagsByName.set(argv[0], argv[1]) process.stderr.write(`setting --app to "${argv[1]}"\n$ `) diff --git a/packages/cli/bin/run b/packages/cli/bin/run index 4bc27ad69a..fed801520a 100755 --- a/packages/cli/bin/run +++ b/packages/cli/bin/run @@ -52,14 +52,14 @@ const main = async () => { try { await config.load() const {_: [commandName, ...args], ...flags} = yargs - if (!args.length && !Object.keys(flags).length) { + if (!commandName && !args.length && !Object.keys(flags).length) { return await herokuRepl(config) } if (flags.prompt) { delete flags.prompt await promptUser(config, commandName, args, flags) } - await oclif.run([commandName, ...args], config) + await oclif.run(undefined, config) await oclifFlush() } catch (error) { // capture any errors raised by oclif