diff options
Diffstat (limited to 'scripts/lib/recipetool')
-rw-r--r-- | scripts/lib/recipetool/newappend.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/scripts/lib/recipetool/newappend.py b/scripts/lib/recipetool/newappend.py index 5625a8ed52..bdf0693ec7 100644 --- a/scripts/lib/recipetool/newappend.py +++ b/scripts/lib/recipetool/newappend.py | |||
@@ -27,6 +27,7 @@ import os | |||
27 | import re | 27 | import re |
28 | import subprocess | 28 | import subprocess |
29 | import sys | 29 | import sys |
30 | import scriptutils | ||
30 | 31 | ||
31 | 32 | ||
32 | logger = logging.getLogger('recipetool') | 33 | logger = logging.getLogger('recipetool') |
@@ -96,12 +97,7 @@ def newappend(args): | |||
96 | return 1 | 97 | return 1 |
97 | 98 | ||
98 | if args.edit: | 99 | if args.edit: |
99 | editor = os.getenv('VISUAL', os.getenv('EDITOR', 'vi')) | 100 | return scriptutils.run_editor([append_path, recipe_path]) |
100 | try: | ||
101 | return subprocess.check_call([editor, append_path, recipe_path]) | ||
102 | except OSError as exc: | ||
103 | logger.error("Execution of editor '%s' failed: %s", editor, exc) | ||
104 | return 1 | ||
105 | else: | 101 | else: |
106 | print(append_path) | 102 | print(append_path) |
107 | 103 | ||