Skip to content

Commit

Permalink
npm-scripts.ts: Fix replaceVersion() in Node 20
Browse files Browse the repository at this point in the history
  • Loading branch information
ibc committed Oct 26, 2023
1 parent 744438a commit c316e2d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion npm-scripts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ function replaceVersion()
continue;
}

const filePath = path.join('lib', file.name);
// NOTE: dirent.path is only available in Node >= 20.
const filePath = path.join(file.path ?? 'lib', file.name);
const text = fs.readFileSync(filePath, { encoding: 'utf8' });
const result = text.replace(/__MEDIASOUP_CLIENT_VERSION__/g, PKG.version);

Expand Down

0 comments on commit c316e2d

Please sign in to comment.