Remove use of __dirname from main process

This commit is contained in:
Fedor Indutny
2026-03-27 10:55:37 -07:00
committed by GitHub
parent 70f111e868
commit a048f83dbc
39 changed files with 222 additions and 337 deletions

View File

@@ -3,6 +3,7 @@
import { parse } from 'csv-parse';
import fs from 'node:fs/promises';
import { join } from 'node:path';
import { z } from 'zod';
import { _getAvailableLocales } from '../../app/locale.node.js';
import { parseUnknown } from '../util/schemas.std.js';
@@ -21,8 +22,9 @@ if (!process.argv[4]) {
throw new Error('Missing third argument: output json file');
}
const localeDisplayNamesBuildPath = process.argv[4];
const rootDir = join(__dirname, '..', '..');
const availableLocales = _getAvailableLocales();
const availableLocales = _getAvailableLocales(rootDir);
const LocaleString = z.string().refine(arg => {
try {