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.
Files changed (2) hide show
  1. package/index.js +5 -4
  2. 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 browserslist --update-db` in?'
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
- return childProcess
76
- .execSync('npx browserslist')
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.stack +
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'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "update-browserslist-db",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "CLI tool to update caniuse-lite to refresh target browsers from Browserslist config",
5
5
  "keywords": [
6
6
  "caniuse",