Skip to content

Commit e4fd554

Browse files
committed
use open 7.0.4 to fix issue
better to use this as vi may not be available on windows
1 parent 1ea9647 commit e4fd554

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
language: node_js
22
node_js:
3-
- "6"
4-
- "6.11"
53
- "8"
64
- "10"
75
cache: yarn

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"gtt": "src/gtt.js"
2121
},
2222
"engines": {
23-
"node": ">=6.11"
23+
"node": ">=8"
2424
},
2525
"pkg": {
2626
"scripts": "src/**/*.js",
@@ -49,7 +49,7 @@
4949
"moment": "^2.22.2",
5050
"moment-timezone": "^0.5.21",
5151
"node-spinner": "^0.0.4",
52-
"open": "^0.0.5",
52+
"open": "^7.0.4",
5353
"progress": "^2.0.0",
5454
"prompt": "^1.0.0",
5555
"read-yaml": "^1.1.0",

src/include/filesystem.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ class filesystem {
2525
static open(file) {
2626
let editor = process.env.VISUAL;
2727

28-
if (!editor && !(editor = process.env.EDITOR)) {
29-
editor = "vi";
28+
if (editor || (editor = process.env.EDITOR)) {
29+
return child_process.spawn(editor, [file], {
30+
stdio: 'inherit'
31+
});
32+
} else {
33+
return (async () => await open(file))().catch(e => console.error(e));
3034
}
3135

3236
return child_process.spawn(editor, [file], {

yarn.lock

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,11 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2:
12061206
is-data-descriptor "^1.0.0"
12071207
kind-of "^6.0.2"
12081208

1209+
is-docker@^2.0.0:
1210+
version "2.0.0"
1211+
resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.0.0.tgz#2cb0df0e75e2d064fe1864c37cdeacb7b2dcf25b"
1212+
integrity sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ==
1213+
12091214
is-extendable@^0.1.0, is-extendable@^0.1.1:
12101215
version "0.1.1"
12111216
resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89"
@@ -1274,6 +1279,13 @@ is-windows@^1.0.2:
12741279
version "1.0.2"
12751280
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
12761281

1282+
is-wsl@^2.1.1:
1283+
version "2.2.0"
1284+
resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271"
1285+
integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==
1286+
dependencies:
1287+
is-docker "^2.0.0"
1288+
12771289
12781290
version "0.0.1"
12791291
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
@@ -1720,9 +1732,13 @@ onetime@^2.0.0:
17201732
dependencies:
17211733
mimic-fn "^1.0.0"
17221734

1723-
open@^0.0.5:
1724-
version "0.0.5"
1725-
resolved "https://registry.yarnpkg.com/open/-/open-0.0.5.tgz#42c3e18ec95466b6bf0dc42f3a2945c3f0cad8fc"
1735+
open@^7.0.4:
1736+
version "7.0.4"
1737+
resolved "https://registry.yarnpkg.com/open/-/open-7.0.4.tgz#c28a9d315e5c98340bf979fdcb2e58664aa10d83"
1738+
integrity sha512-brSA+/yq+b08Hsr4c8fsEW2CRzk1BmfN3SAK/5VCHQ9bdoZJ4qa/+AfR0xHjlbbZUyPkUHs1b8x1RqdyZdkVqQ==
1739+
dependencies:
1740+
is-docker "^2.0.0"
1741+
is-wsl "^2.1.1"
17261742

17271743
optimist@^0.6.1:
17281744
version "0.6.1"

0 commit comments

Comments
 (0)