Commit ab392626 authored by Flavio TARSETTI's avatar Flavio TARSETTI
Browse files

[common] check that VISUAL or EDITOR is set in the environment

parent 0cf41ae9
Pipeline #20551 passed with stages
in 25 minutes and 33 seconds
......@@ -575,9 +575,9 @@ def edit_local_file(prefix, editor, type, name):
if os.path.isfile(object_path):
# check if editor set
if editor is None:
if len(os.environ['VISUAL']) > 0:
if 'VISUAL' in os.environ and len(os.environ['VISUAL']) > 0:
editor = os.environ['VISUAL']
elif len(os.environ['EDITOR']) > 0:
elif 'EDITOR' in os.environ and len(os.environ['EDITOR']) > 0:
editor = os.environ['EDITOR']
else:
logger.error("No default editor set in your environment variable")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment