Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add oci-env edit-env command #73

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

newswangerd
Copy link
Collaborator

Launches vim to edit the current compose.env file. Works with the -e flag. The editor can be configured via the OCI_ENV_EDITOR env var, but will default to vim.


def edit_env(args):
editor = os.getenv("OCI_ENV_EDITOR", "vim")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "EDITOR" is a wildly used variable for this. Also xdg-open seems like a very good option. WDYT?

https://stackoverflow.com/questions/19252791/how-to-open-the-default-text-editor-in-linux



def edit_env(args):
editor = os.getenv("EDITOR", "vim")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we default it to a "more" common editor, like vi?
Not all distributions come with vim installed by default.

Comment on lines +133 to +134
'Edit your current environment file in vim. To change the default editor, set the '
'EDITOR environment variable to the path for the binary of your choosing.'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'Edit your current environment file in vim. To change the default editor, set the '
'EDITOR environment variable to the path for the binary of your choosing.'
'Open the current environment file using your default EDITOR (or vi/vim if none is found).'
'To change the default editor, set the EDITOR environment variable to the path for '
'binary of your choosing.'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants