+22
-10
lines changedFilter options
+22
-10
lines changed Original file line number Diff line number Diff line change
@@ -131,9 +131,19 @@ const open = (_args, opts = {}, extra = {}) => {
131
131
132
132
let platform = process.platform
133
133
// process.platform === 'linux' may actually indicate WSL, if that's the case
134
-
// we want to treat things as win32 anyway so the host can open the argument
134
+
// open the argument with sensible-browser which is pre-installed
135
+
// In WSL, set the default browser using, for example,
136
+
// export BROWSER="/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"
137
+
// or
138
+
// export BROWSER="/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
139
+
// To permanently set the default browser, add the appropriate entry to your shell's
140
+
// RC file, e.g. .bashrc or .zshrc.
135
141
if (platform === 'linux' && os.release().toLowerCase().includes('microsoft')) {
136
-
platform = 'win32'
142
+
platform = 'wsl'
143
+
if (!process.env.BROWSER) {
144
+
return Promise.reject(
145
+
new Error('Set the BROWSER environment variable to your desired browser.'))
146
+
}
137
147
}
138
148
139
149
let command = options.command
@@ -146,6 +156,8 @@ const open = (_args, opts = {}, extra = {}) => {
146
156
// accidentally interpret the first arg as the title, we stick an empty
147
157
// string immediately after the start command
148
158
command = 'start ""'
159
+
} else if (platform === 'wsl') {
160
+
command = 'sensible-browser'
149
161
} else if (platform === 'darwin') {
150
162
command = 'open'
151
163
} else {
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "@npmcli/promise-spawn",
3
-
"version": "8.0.1",
3
+
"version": "8.0.2",
4
4
"files": [
5
5
"bin/",
6
6
"lib/"
@@ -33,7 +33,7 @@
33
33
},
34
34
"devDependencies": {
35
35
"@npmcli/eslint-config": "^5.0.0",
36
-
"@npmcli/template-oss": "4.23.3",
36
+
"@npmcli/template-oss": "4.23.4",
37
37
"spawk": "^1.7.1",
38
38
"tap": "^16.0.1"
39
39
},
@@ -42,7 +42,7 @@
42
42
},
43
43
"templateOSS": {
44
44
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
45
-
"version": "4.23.3",
45
+
"version": "4.23.4",
46
46
"publish": true
47
47
},
48
48
"dependencies": {
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@
90
90
"@npmcli/fs": "^4.0.0",
91
91
"@npmcli/map-workspaces": "^4.0.2",
92
92
"@npmcli/package-json": "^6.0.1",
93
-
"@npmcli/promise-spawn": "^8.0.1",
93
+
"@npmcli/promise-spawn": "^8.0.2",
94
94
"@npmcli/redact": "^3.0.0",
95
95
"@npmcli/run-script": "^9.0.1",
96
96
"@sigstore/tuf": "^3.0.0",
@@ -3464,9 +3464,9 @@
3464
3464
}
3465
3465
},
3466
3466
"node_modules/@npmcli/promise-spawn": {
3467
-
"version": "8.0.1",
3468
-
"resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-8.0.1.tgz",
3469
-
"integrity": "sha512-ZscqKtJqy7oj6MgXEJcHQ1om4utU0Q84QtC28UVuiO6ALSO9sDPanXdu6Wd1oYhItW8fx2u96zRFUE8BuPlAjA==",
3467
+
"version": "8.0.2",
3468
+
"resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-8.0.2.tgz",
3469
+
"integrity": "sha512-/bNJhjc+o6qL+Dwz/bqfTQClkEO5nTQ1ZEcdCkAQjhkZMHIh22LPG7fNh1enJP1NKWDqYiiABnjFCY7E0zHYtQ==",
3470
3470
"inBundle": true,
3471
3471
"license": "ISC",
3472
3472
"dependencies": {
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@
57
57
"@npmcli/fs": "^4.0.0",
58
58
"@npmcli/map-workspaces": "^4.0.2",
59
59
"@npmcli/package-json": "^6.0.1",
60
-
"@npmcli/promise-spawn": "^8.0.1",
60
+
"@npmcli/promise-spawn": "^8.0.2",
61
61
"@npmcli/redact": "^3.0.0",
62
62
"@npmcli/run-script": "^9.0.1",
63
63
"@sigstore/tuf": "^3.0.0",
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4