update-browserslist-db 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -28,7 +28,7 @@ function detectLockfile() {
|
|
|
28
28
|
if (!packageDir) {
|
|
29
29
|
throw new BrowserslistUpdateError(
|
|
30
30
|
'Cannot find package.json. ' +
|
|
31
|
-
'Is this the right directory to run `npx
|
|
31
|
+
'Is this the right directory to run `npx update-browserslist-db` in?'
|
|
32
32
|
)
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -72,8 +72,9 @@ function getLatestInfo(lock) {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
function getBrowsersList() {
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
let spawn = childProcess.spawnSync('npx', ['browserslist'])
|
|
76
|
+
if (spawn.status !== 0) throw new Error(spawn.stderr.toString())
|
|
77
|
+
return spawn.stdout
|
|
77
78
|
.toString()
|
|
78
79
|
.trim()
|
|
79
80
|
.split('\n')
|
|
@@ -310,7 +311,7 @@ module.exports = function updateDB(print = defaultPrint) {
|
|
|
310
311
|
print(
|
|
311
312
|
pico.red(
|
|
312
313
|
'\n' +
|
|
313
|
-
browsersListRetrievalError.
|
|
314
|
+
browsersListRetrievalError.message +
|
|
314
315
|
'\n\n' +
|
|
315
316
|
'Problem with browser list retrieval.\n' +
|
|
316
317
|
'Target browser changes won’t be shown.\n'
|