Browse Source

fix(scripts): upgrade nocodb sdk logic

pull/5903/head
Wing-Kam Wong 1 year ago
parent
commit
a028eb9f8c
  1. 25
      scripts/upgradeNocodbSdk.js

25
scripts/upgradeNocodbSdk.js

@ -18,11 +18,28 @@ const replacePackageName = (filePath) => {
})
}
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);
return fs.writeFile(filePath, result, 'utf8', function (err) {
if (err) return reject(err)
return resolve()
});
});
})
}
const bumbVersionAndSave = () => {
// upgrade nocodb-sdk version in nocodb
execSync(`pnpm --filter=nocodb install ${nocodbSdkPackage.name}@${nocodbSdkPackage.version}`, {});
// upgrade nocodb-sdk version in nc-gui
execSync(`pnpm --filter=nc-gui install ${nocodbSdkPackage.name}@${nocodbSdkPackage.version}`, {});
// upgrade nocodb-sdk version in nocodb & nc-gui
Promise.all([
replacePackageVersion(path.join(__dirname, '..', 'packages', 'nocodb', 'package.json')),
replacePackageVersion(path.join(__dirname, '..', 'packages', 'nc-gui', 'package.json')),
]).then(() => {
execSync(`pnpm --filter=nocodb --filter=nc-gui install`, {});
})
}
const dfs = function(dir) {

Loading…
Cancel
Save