Skip to content

Commit d5c0e8a

Browse files
authored
feat: update heroku-cli-command, refactor REPL, remove deprecated commands (#3542)
* move repl to actual repl command, replace custom prompt mode with heroku-cli-command version * move repl logic into lib, add tests * Update heroku-cli-command version, remove --prompt global flags from commands without args/flags, delete prompt command, delete deprecated pg upgrade command * remove pg:upgrade from commands-output * remove heroku-repl.js, now that it has been moved to lib/repl.ts * disable prompt mode for pg:update and pg:create
1 parent aec5e49 commit d5c0e8a

24 files changed

Lines changed: 427 additions & 1477 deletions

File tree

bin/heroku-prompts.js

Lines changed: 0 additions & 235 deletions
This file was deleted.

bin/run

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22
/* eslint-disable n/no-process-exit */
33
/* eslint-disable n/no-unpublished-bin */
44

5-
import {Config, execute} from '@oclif/core'
6-
import {dirname} from 'node:path'
7-
import {fileURLToPath} from 'node:url'
8-
import yargs from 'yargs-parser'
5+
import {execute} from '@oclif/core'
96

107
import * as globalTelemetry from '../dist/global_telemetry.js'
11-
import {herokuRepl} from './heroku-repl.js'
128

139
process.env.HEROKU_UPDATE_INSTRUCTIONS = process.env.HEROKU_UPDATE_INSTRUCTIONS || 'update with: "npm update -g heroku"'
1410

@@ -48,14 +44,4 @@ process.on('SIGTERM', async () => {
4844

4945
globalTelemetry.initializeInstrumentation()
5046

51-
// Check for --repl flag before executing
52-
const parsedArgs = yargs(process.argv.slice(2))
53-
const {_: [commandName, ...args], ...flags} = parsedArgs
54-
if (flags.repl && args.length === 0 && Object.keys(flags).length === 1) {
55-
const __filename = fileURLToPath(import.meta.url)
56-
const __dirname = dirname(__filename)
57-
const config = await Config.load({root: dirname(__dirname)})
58-
await herokuRepl(config)
59-
} else {
60-
await execute({dir: import.meta.url})
61-
}
47+
await execute({dir: import.meta.url})

docs/repl.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Use it when running multiple commands in sequence or exploring the CLI.
1616

1717
Start a REPL interactive environment with this command:
1818
```term
19-
$ heroku --repl
19+
$ heroku repl
2020
```
2121
## Exit a REPL
2222

@@ -27,7 +27,7 @@ To exit the REPL, type `exit` or press `Ctrl`+`D`.
2727
You can set flags that persist across commands. For example, to persist an app's name in your commands:
2828

2929
```term
30-
$ heroku --repl
30+
$ heroku repl
3131
heroku> set app example-app
3232
setting --app to example-app
3333
example-app> ps

0 commit comments

Comments
 (0)