mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Merge dev.
This commit is contained in:
commit
be1b2fc272
88 changed files with 4120 additions and 21010 deletions
19
scripts/update-tracker.mjs
Normal file
19
scripts/update-tracker.mjs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/* eslint-disable no-console */
|
||||
import 'dotenv/config';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import url from "node:url";
|
||||
|
||||
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
||||
|
||||
const endPoint = process.env.COLLECT_API_ENDPOINT;
|
||||
|
||||
if (endPoint) {
|
||||
const file = path.resolve(__dirname, '../public/script.js');
|
||||
|
||||
const tracker = fs.readFileSync(file);
|
||||
|
||||
fs.writeFileSync(path.resolve(file), tracker.toString().replace(/\/api\/send/g, endPoint));
|
||||
|
||||
console.log(`Updated tracker endpoint: ${endPoint}.`);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue