提交 217ce025 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

npm-scripts: improve replaceVersion()

上级 369a0157
......@@ -263,19 +263,24 @@ function replaceVersion()
{
logInfo('replaceVersion()');
const files =
[
'node/lib/index.js',
'node/lib/index.d.ts',
'node/lib/Worker.js'
];
const files = fs.readdirSync('node/lib',
{
withFileTypes : true,
recursive : true
});
for (const file of files)
{
const text = fs.readFileSync(file, { encoding: 'utf8' });
if (!file.isFile())
{
continue;
}
const filePath = path.join('node/lib', file.name);
const text = fs.readFileSync(filePath, { encoding: 'utf8' });
const result = text.replace(/__MEDIASOUP_VERSION__/g, PKG.version);
fs.writeFileSync(file, result, { encoding: 'utf8' });
fs.writeFileSync(filePath, result, { encoding: 'utf8' });
}
}
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论