Fix m.version to not depend on package.json (#2464)
* Fix `m.version` to not depend on `package.json` Created an accidental breaking change. * Update changelog * Fix a failing test
This commit is contained in:
parent
1f4b2cf49a
commit
1434ba313f
7 changed files with 13 additions and 15 deletions
10
scripts/update-version.js
Normal file
10
scripts/update-version.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
"use strict"
|
||||
|
||||
const fs = require("fs")
|
||||
const version = require("../package.json").version
|
||||
const index = require.resolve("../index")
|
||||
|
||||
fs.writeFile(index,
|
||||
fs.readFile(index, "utf-8")
|
||||
.replace(/(version\s*=\s*)(['"]).*?\2/, `$1$2${version}$2`)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue