You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DESCRIPTION
This command opens the app config in a text editor set by $VISUAL or $EDITOR.
Any variables added/removed/changed will be updated on the app after saving and closing the file.
EXAMPLES
# edit with vim
$ EDITOR="vim" heroku config:edit
# edit with emacs
$ EDITOR="emacs" heroku config:edit
# edit with pico
$ EDITOR="pico" heroku config:edit
# edit with atom editor
$ VISUAL="atom --wait" heroku config:edit
This works if I set EDITOR (or VISUAL) to a single command (such as code), however fails if I pass in additional arguments as per the final example in the help text.
$ EDITOR='code --wait' h config:edit
Fetching config... done
Waiting for code --wait... Error: spawn code --wait ENOENT
In VSCode's case, the argument --wait is required to make the editor wait for the window to be closed before the command returns (otherwise one gets a › Warning: no changes to config warning from the Heroku CLI, as the command returned early).
This is using macOS 12.3.1 with Homebrew bash.
What is the expected behavior?
That:
The examples reflect what works
It's possible to have EDITOR or VISUAL set to values that include arguments to commands.
This editor functionality is provided by the edit-string package, called here:
I was hoping to work around this by eg creating a bash alias to wrap the --wait arg, however the edit-string package doesn't use the shell option with its execa usage, so that doesn't work.
However, a workaround that does work is to create a script that wraps the call and put that on PATH.
eg:
#!/usr/bin/env bashexec code --wait "$@"
-> Ensure on path
-> export EDITOR='<script-name>.sh'
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
The
config:edit
help text says:This works if I set
EDITOR
(orVISUAL
) to a single command (such ascode
), however fails if I pass in additional arguments as per the final example in the help text.In VSCode's case, the argument
--wait
is required to make the editor wait for the window to be closed before the command returns (otherwise one gets a› Warning: no changes to config
warning from the Heroku CLI, as the command returned early).This is using macOS 12.3.1 with Homebrew bash.
What is the expected behavior?
That:
EDITOR
orVISUAL
set to values that include arguments to commands.This editor functionality is provided by the
edit-string
package, called here:cli/packages/config/src/commands/config/edit.ts
Line 105 in b8292f3
Whose implementation is here:
https://github.com/jdxcode/edit-string/blob/v1.1.6/src/edit.ts
The text was updated successfully, but these errors were encountered: