mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Switched to type: module.
This commit is contained in:
parent
615a6d444f
commit
4e37e10b6d
20 changed files with 25 additions and 50 deletions
16
scripts/update-tracker.js
Normal file
16
scripts/update-tracker.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/* eslint-disable no-console */
|
||||
import 'dotenv/config';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
const endPoint = process.env.COLLECT_API_ENDPOINT;
|
||||
|
||||
if (endPoint) {
|
||||
const file = path.resolve(process.cwd(), '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