mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-22 12:28:44 -05:00
ci: auto detect chrome version
This commit is contained in:
@@ -5,6 +5,8 @@ const fs = require('fs')
|
||||
const path = require('path')
|
||||
const pkg = require('../package.json')
|
||||
|
||||
pkg.resolutions.chromedriver = '2.45.0'
|
||||
const versionString = require('child_process').execSync('wmic datafile where name="C:\\\\Program Files (x86)\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe" get Version /value').toString()
|
||||
const majorVersion = versionString.match(/Version=(\d+)/)[1]
|
||||
pkg.resolutions.chromedriver = `^${majorVersion}.0.0`
|
||||
|
||||
fs.writeFileSync(path.resolve(__dirname, '../package.json'), JSON.stringify(pkg, null, 2))
|
||||
|
||||
Reference in New Issue
Block a user