From 0bc6cf1178cf5aae9f500a48ad4c3920c0674f85 Mon Sep 17 00:00:00 2001 From: J87 <68929154+jake-87@users.noreply.github.com> Date: Sun, 21 Nov 2021 20:25:33 +1100 Subject: [PATCH] Minified getEditor function. --- packages/ctl/ctl.js | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/packages/ctl/ctl.js b/packages/ctl/ctl.js index ab06e614..00c065a5 100755 --- a/packages/ctl/ctl.js +++ b/packages/ctl/ctl.js @@ -37,21 +37,11 @@ function print(...content) { } async function getEditor(argsEditor) { - let editor = ""; - if (argsEditor) { - editor = argsEditor; - /* eslint-disable */ - } else if (process.env.EDITOR) { - editor = process.env.EDITOR; - } else if (process.env.VISUAL) { - editor = process.env.VISUAL - /* eslint-enable */ - // needed for the process.env statements to not be flagged by eslint - // prio for editors is CLI arg > env.EDITOR > env.VISUAL - } else { - editor = -1; - } - return editor; + /* eslint-disable */ + return argsEditor || process.ENV.EDITOR || process.env.VISUAL || -1 + /* eslint-enable */ + // needed for the process.env statements to not be flagged by eslint + // prio for editors is CLI arg > env.EDITOR > env.VISUAL } async function configToKeyVal(data) {