Skip to content

Commit e2a5c92

Browse files
committed
tweak: highlight every non-ascii char in path error message
1 parent 77987f3 commit e2a5c92

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

core/globalData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ if (dataPathVar) {
209209
//NOTE: Non-ASCII in one of those paths (don't know which) will make NodeJS crash due to a bug in v8 (or something)
210210
// when running localization methods like Date.toLocaleString().
211211
// There was also an issue with the slash() lib and with the +exec on FXServer
212-
const nonASCIIRegex = /[^\x00-\x80]+/;
212+
const nonASCIIRegex = /[^\x00-\x80]+/g;
213213
const colorNonAscii = (x: string) => chalk.black.bgGreenBright(
214-
x.replace(nonASCIIRegex, (m) => chalk.bgRedBright(m))
214+
x.replaceAll(nonASCIIRegex, (m) => chalk.bgRedBright(m))
215215
);
216216
if (nonASCIIRegex.test(fxsPath) || nonASCIIRegex.test(dataPath)) {
217217
fatalError.GlobalData(7, [

0 commit comments

Comments
 (0)