From 2890457fa585d0fde4636201ee53f54bec744b98 Mon Sep 17 00:00:00 2001 From: boltgolt Date: Mon, 22 Jun 2020 18:00:33 +0200 Subject: [PATCH] Fix editor prio as per #333 --- src/cli/config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli/config.py b/src/cli/config.py index 4f6caca..764833d 100644 --- a/src/cli/config.py +++ b/src/cli/config.py @@ -11,10 +11,10 @@ print("Opening config.ini in the default editor") editor = "/bin/nano" # Use the user preferred editor if available -if os.path.isfile("/etc/alternatives/editor"): - editor = "/etc/alternatives/editor" -elif "EDITOR" in os.environ: +if "EDITOR" in os.environ: editor = os.environ["EDITOR"] +elif os.path.isfile("/etc/alternatives/editor"): + editor = "/etc/alternatives/editor" # Open the editor as a subprocess and fork it subprocess.call([editor, os.path.dirname(os.path.realpath(__file__)) + "/../config.ini"])