Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.cmdline
Commits
ab392626
Commit
ab392626
authored
May 28, 2018
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
beat/cmdline/common.py
View file @
ab392626
...
...
@@ -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"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment