|
|
@ -1,25 +1,9 @@
|
|
|
|
/**
|
|
|
|
const pkg = require("../package.json");
|
|
|
|
* String.prototype.replaceAll() polyfill
|
|
|
|
const fs = require("fs");
|
|
|
|
* https://gomakethings.com/how-to-replace-a-section-of-a-string-with-another-one-with-vanilla-js/
|
|
|
|
const util = require("../src/util");
|
|
|
|
* @author Chris Ferdinandi
|
|
|
|
|
|
|
|
* @license MIT
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (!String.prototype.replaceAll) {
|
|
|
|
|
|
|
|
String.prototype.replaceAll = function(str, newStr){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If a regex pattern
|
|
|
|
|
|
|
|
if (Object.prototype.toString.call(str).toLowerCase() === '[object regexp]') {
|
|
|
|
|
|
|
|
return this.replace(str, newStr);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If a string
|
|
|
|
|
|
|
|
return this.replace(new RegExp(str, 'g'), newStr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
util.polyfill();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const pkg = require('../package.json');
|
|
|
|
|
|
|
|
const fs = require("fs");
|
|
|
|
|
|
|
|
const oldVersion = pkg.version
|
|
|
|
const oldVersion = pkg.version
|
|
|
|
const newVersion = oldVersion + "-nightly"
|
|
|
|
const newVersion = oldVersion + "-nightly"
|
|
|
|
|
|
|
|
|
|
|
@ -35,6 +19,6 @@ if (newVersion) {
|
|
|
|
|
|
|
|
|
|
|
|
// Process README.md
|
|
|
|
// Process README.md
|
|
|
|
if (fs.existsSync("README.md")) {
|
|
|
|
if (fs.existsSync("README.md")) {
|
|
|
|
fs.writeFileSync("README.md", fs.readFileSync("README.md", 'utf8').replaceAll(oldVersion, newVersion))
|
|
|
|
fs.writeFileSync("README.md", fs.readFileSync("README.md", "utf8").replaceAll(oldVersion, newVersion))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|