refactor: use path.sep to be cross-platform
This commit is contained in:
parent
ab5287a3d4
commit
218c1a5a50
@ -1,6 +1,6 @@
|
|||||||
import "minimal-polyfills/Object.fromEntries";
|
import "minimal-polyfills/Object.fromEntries";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { join as pathJoin, relative as pathRelative, dirname as pathDirname } from "path";
|
import { join as pathJoin, relative as pathRelative, dirname as pathDirname, sep as pathSep } from "path";
|
||||||
import { crawl } from "../src/bin/tools/crawl";
|
import { crawl } from "../src/bin/tools/crawl";
|
||||||
import { downloadBuiltinKeycloakTheme } from "../src/bin/download-builtin-keycloak-theme";
|
import { downloadBuiltinKeycloakTheme } from "../src/bin/download-builtin-keycloak-theme";
|
||||||
import { getProjectRoot } from "../src/bin/tools/getProjectRoot";
|
import { getProjectRoot } from "../src/bin/tools/getProjectRoot";
|
||||||
@ -35,11 +35,10 @@ async function main() {
|
|||||||
|
|
||||||
{
|
{
|
||||||
const baseThemeDirPath = pathJoin(tmpDirPath, "base");
|
const baseThemeDirPath = pathJoin(tmpDirPath, "base");
|
||||||
|
const re = new RegExp(`^([^\\${pathSep}]+)\\${pathSep}messages\\${pathSep}messages_([^.]+).properties$`);
|
||||||
|
|
||||||
crawl(baseThemeDirPath).forEach(filePath => {
|
crawl(baseThemeDirPath).forEach(filePath => {
|
||||||
const match =
|
const match = filePath.match(re);
|
||||||
filePath.match(/^([^/]+)\/messages\/messages_([^.]+)\.properties$/) ||
|
|
||||||
filePath.match(/^([^\\]+)\\messages\\messages_([^.]+)\.properties$/);
|
|
||||||
|
|
||||||
if (match === null) {
|
if (match === null) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user