Skip to content

Commit

Permalink
Convert backslashes to slashes before string replace
Browse files Browse the repository at this point in the history
(closes #1577)

They will be backslashes when the script runs on Windows.
The node:fs functions can handle either, but string.replace needs them consistent.
  • Loading branch information
bhousel committed Jan 17, 2025
1 parent e23d7b7 commit 4cee11f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/build_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function buildDataAsync() {

// copy `data/` files to `dist/data/` and stamp with metadata
for (const sourceFile of globSync('data/**/*.json')) {
const destinationFile = sourceFile.replace('data/', 'dist/data/');
const destinationFile = sourceFile.replace(/\\/g, '/').replace('data/', 'dist/data/');
copyToDistSync(sourceFile, destinationFile);
}

Expand Down

0 comments on commit 4cee11f

Please sign in to comment.