From 1ea96475ab89fbf57704e413b48194a188e77e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Ram=C3=B3n=20Meneu?= Date: Fri, 5 Jun 2020 11:01:53 +0200 Subject: [PATCH 1/3] Solving error launched running command gtt config when neither EDITOR nor VISUAL environnement variables are set --- src/include/filesystem.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/include/filesystem.js b/src/include/filesystem.js index 7de072f..9e13f2b 100755 --- a/src/include/filesystem.js +++ b/src/include/filesystem.js @@ -25,13 +25,13 @@ class filesystem { static open(file) { let editor = process.env.VISUAL; - if (editor || (editor = process.env.EDITOR)) { - return child_process.spawn(editor, [file], { - stdio: 'inherit' - }); - } else { - return open(file); + if (!editor && !(editor = process.env.EDITOR)) { + editor = "vi"; } + + return child_process.spawn(editor, [file], { + stdio: 'inherit' + }); } static join(...args) { From e4fd554e304db138c2b48e93d269cf7691118b4e Mon Sep 17 00:00:00 2001 From: Ciprian Dobre-Trifan Date: Wed, 1 Jul 2020 12:35:51 +0300 Subject: [PATCH 2/3] use open 7.0.4 to fix issue better to use this as vi may not be available on windows --- .travis.yml | 2 -- package.json | 4 ++-- src/include/filesystem.js | 8 ++++++-- yarn.lock | 22 +++++++++++++++++++--- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 71d9c2d..f033fc1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,5 @@ language: node_js node_js: - - "6" - - "6.11" - "8" - "10" cache: yarn diff --git a/package.json b/package.json index 8dc55e8..8313459 100755 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "gtt": "src/gtt.js" }, "engines": { - "node": ">=6.11" + "node": ">=8" }, "pkg": { "scripts": "src/**/*.js", @@ -49,7 +49,7 @@ "moment": "^2.22.2", "moment-timezone": "^0.5.21", "node-spinner": "^0.0.4", - "open": "^0.0.5", + "open": "^7.0.4", "progress": "^2.0.0", "prompt": "^1.0.0", "read-yaml": "^1.1.0", diff --git a/src/include/filesystem.js b/src/include/filesystem.js index 9e13f2b..2a14e3c 100755 --- a/src/include/filesystem.js +++ b/src/include/filesystem.js @@ -25,8 +25,12 @@ class filesystem { static open(file) { let editor = process.env.VISUAL; - if (!editor && !(editor = process.env.EDITOR)) { - editor = "vi"; + if (editor || (editor = process.env.EDITOR)) { + return child_process.spawn(editor, [file], { + stdio: 'inherit' + }); + } else { + return (async () => await open(file))().catch(e => console.error(e)); } return child_process.spawn(editor, [file], { diff --git a/yarn.lock b/yarn.lock index 2da1b0d..2c37b7f 100755 --- a/yarn.lock +++ b/yarn.lock @@ -1206,6 +1206,11 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: is-data-descriptor "^1.0.0" kind-of "^6.0.2" +is-docker@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.0.0.tgz#2cb0df0e75e2d064fe1864c37cdeacb7b2dcf25b" + integrity sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ== + is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -1274,6 +1279,13 @@ is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" +is-wsl@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" + integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== + dependencies: + is-docker "^2.0.0" + isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" @@ -1720,9 +1732,13 @@ onetime@^2.0.0: dependencies: mimic-fn "^1.0.0" -open@^0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/open/-/open-0.0.5.tgz#42c3e18ec95466b6bf0dc42f3a2945c3f0cad8fc" +open@^7.0.4: + version "7.0.4" + resolved "https://registry.yarnpkg.com/open/-/open-7.0.4.tgz#c28a9d315e5c98340bf979fdcb2e58664aa10d83" + integrity sha512-brSA+/yq+b08Hsr4c8fsEW2CRzk1BmfN3SAK/5VCHQ9bdoZJ4qa/+AfR0xHjlbbZUyPkUHs1b8x1RqdyZdkVqQ== + dependencies: + is-docker "^2.0.0" + is-wsl "^2.1.1" optimist@^0.6.1: version "0.6.1" From 9e070d9338942a1c6622b6e0ac393cf3055ea830 Mon Sep 17 00:00:00 2001 From: Ciprian Dobre-Trifan Date: Wed, 1 Jul 2020 12:38:49 +0300 Subject: [PATCH 3/3] Update filesystem.js fix merge error --- src/include/filesystem.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/include/filesystem.js b/src/include/filesystem.js index 2a14e3c..f42c3e4 100755 --- a/src/include/filesystem.js +++ b/src/include/filesystem.js @@ -32,10 +32,6 @@ class filesystem { } else { return (async () => await open(file))().catch(e => console.error(e)); } - - return child_process.spawn(editor, [file], { - stdio: 'inherit' - }); } static join(...args) {