Skip to content

Commit

Permalink
fixed a small issue with enternig repl mode and added an exit command
Browse files Browse the repository at this point in the history
  • Loading branch information
justinwilaby committed Jan 30, 2025
1 parent c3e72a4 commit c3c00b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/cli/bin/heroku-repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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$ `)
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/bin/run
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c3c00b6

Please sign in to comment.