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

npm-scripts: improve replaceVersion()

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