Browse Source

chore: logic for replacing version

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/6759/head
mertmit 1 year ago
parent
commit
ed28ca4e12
  1. 3
      scripts/upgradeNocodbSdk.js

3
scripts/upgradeNocodbSdk.js

@ -22,7 +22,8 @@ const replacePackageVersion = (filePath) => {
return new Promise((resolve, reject) => {
return fs.readFile(filePath, 'utf8', function (err, data) {
if (err) return reject(err)
var result = data.replace(/workspace:\^/g, nocodbSdkPackage.version);
const rgx = new RegExp(`"${nocodbSdkPackage.name}": "(.*)"`, "g");
var result = data.replace(rgx, `"${nocodbSdkPackage.name}": "${nocodbSdkPackage.version}"`);
return fs.writeFile(filePath, result, 'utf8', function (err) {
if (err) return reject(err)
return resolve()

Loading…
Cancel
Save