Browse Source

chore(action): release-npm.yml - specify `utf8` encoding to read file content as string

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/1620/head
Pranav C 3 years ago
parent
commit
29da7613a9
  1. 8
      scripts/upgradeNocodbSdk.js

8
scripts/upgradeNocodbSdk.js

@ -5,7 +5,7 @@ const { mainModule } = require('process');
const execSync = require('child_process').execSync;
// extract latest version from package.json
const nocodbSdkPackage = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'packages', 'nocodb-sdk', 'package.json')))
const nocodbSdkPackage = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'packages', 'nocodb-sdk', 'package.json'), 'utf8'))
const replacePackageName = (filePath) => {
return new Promise((resolve, reject) => {
@ -33,9 +33,9 @@ const dfs = function(dir) {
list.forEach(function(file) {
file = dir + '/' + file;
var stat = fs.statSync(file);
if (stat && stat.isDirectory()) {
if (stat && stat.isDirectory()) {
res = res.concat(dfs(file));
} else {
} else {
const ext = path.extname(file).toLowerCase()
if (ext == '.vue' || ext == '.ts') {
res.push(file);
@ -49,7 +49,7 @@ const searchAndReplace = (target) => {
const dirPath = path.resolve(path.join(__dirname, '..', 'packages'))
let list = dfs(dirPath)
list = [
...list,
...list,
path.join(__dirname, '..', 'packages', 'nc-gui', 'package.json'),
path.join(__dirname, '..', 'packages', 'nocodb', 'package.json')
]

Loading…
Cancel
Save