mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Updated script requires.
This commit is contained in:
parent
ec7d5bdfe2
commit
615a6d444f
6 changed files with 9 additions and 6 deletions
|
|
@ -5,8 +5,8 @@ import chalk from 'chalk';
|
||||||
import { createRequire } from "module";
|
import { createRequire } from "module";
|
||||||
|
|
||||||
const require = createRequire(import.meta.url);
|
const require = createRequire(import.meta.url);
|
||||||
const messages = require('../src/lang/en-US.json');
|
const messages = require(path.resolve(process.cwd(), 'src/lang/en-US.json'));
|
||||||
const ignore = require('../lang-ignore.json');
|
const ignore = require(path.resolve(process.cwd(), 'lang-ignore.json'));
|
||||||
const dir = path.resolve(process.cwd(), 'lang');
|
const dir = path.resolve(process.cwd(), 'lang');
|
||||||
const files = fs.readdirSync(dir);
|
const files = fs.readdirSync(dir);
|
||||||
const keys = Object.keys(messages).sort();
|
const keys = Object.keys(messages).sort();
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import fs from 'fs-extra';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import https from 'https';
|
import https from 'https';
|
||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import url from "node:url";
|
|
||||||
|
|
||||||
const src = path.resolve(process.cwd(), 'src/lang');
|
const src = path.resolve(process.cwd(), 'src/lang');
|
||||||
const dest = path.resolve(process.cwd(), 'public/intl/country');
|
const dest = path.resolve(process.cwd(), 'public/intl/country');
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ async function run() {
|
||||||
await fs.ensureDir(dest);
|
await fs.ensureDir(dest);
|
||||||
|
|
||||||
files.forEach(file => {
|
files.forEach(file => {
|
||||||
const lang = require(`../src/lang/${file}`);
|
const lang = require(path.resolve(process.cwd() `src/lang/${file}`));
|
||||||
const keys = Object.keys(lang).sort();
|
const keys = Object.keys(lang).sort();
|
||||||
|
|
||||||
const formatted = keys.reduce((obj, key) => {
|
const formatted = keys.reduce((obj, key) => {
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ with the existing files under `lang`. Any newly added
|
||||||
keys will be printed to the console.
|
keys will be printed to the console.
|
||||||
*/
|
*/
|
||||||
files.forEach(file => {
|
files.forEach(file => {
|
||||||
const lang = require(`../src/lang/${file}`);
|
const lang = require(path.resolve(process.cwd(), `src/lang/${file}`));
|
||||||
|
|
||||||
console.log(`Merging ${file}`);
|
console.log(`Merging ${file}`);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,9 @@
|
||||||
import 'dotenv/config';
|
import 'dotenv/config';
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
|
import { createRequire } from "module";
|
||||||
|
|
||||||
|
const require = createRequire(import.meta.url);
|
||||||
|
|
||||||
const routesManifestPath = path.resolve(process.cwd(), '.next/routes-manifest.json');
|
const routesManifestPath = path.resolve(process.cwd(), '.next/routes-manifest.json');
|
||||||
const originalPath = path.resolve(process.cwd(), '.next/routes-manifest-orig.json');
|
const originalPath = path.resolve(process.cwd(), '.next/routes-manifest-orig.json');
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
import os from 'node:os';
|
import os from 'node:os';
|
||||||
|
import path from 'node:path';
|
||||||
import isCI from 'is-ci';
|
import isCI from 'is-ci';
|
||||||
import { createRequire } from 'module';
|
import { createRequire } from 'module';
|
||||||
|
|
||||||
const require = createRequire(import.meta.url);
|
const require = createRequire(import.meta.url);
|
||||||
const pkg = require('../package.json');
|
const pkg = require(path.resolve(process.cwd(), 'package.json'));
|
||||||
|
|
||||||
const url = 'https://api.umami.is/v1/telemetry';
|
const url = 'https://api.umami.is/v1/telemetry';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue