mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
Added postbuild script.
This commit is contained in:
parent
0d33e6d08f
commit
a249f0c6dc
3 changed files with 13 additions and 6 deletions
10
scripts/postbuild.js
Normal file
10
scripts/postbuild.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
require('dotenv').config();
|
||||
const sendTelemetry = require('./telemetry');
|
||||
|
||||
async function run() {
|
||||
if (!process.env.TELEMETRY_DISABLE) {
|
||||
await sendTelemetry();
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
require('dotenv').config();
|
||||
const fs = require('fs-extra');
|
||||
const path = require('path');
|
||||
const os = require('os');
|
||||
|
|
@ -9,7 +8,7 @@ const pkg = require('../package.json');
|
|||
const dest = path.resolve(__dirname, '../.next/cache/umami.json');
|
||||
const url = 'https://telemetry.umami.is/api/collect';
|
||||
|
||||
async function run() {
|
||||
async function sendTelemetry() {
|
||||
await fs.ensureFile(dest);
|
||||
|
||||
let json = {};
|
||||
|
|
@ -52,6 +51,4 @@ async function run() {
|
|||
}
|
||||
}
|
||||
|
||||
if (!process.env.TELEMETRY_DISABLED) {
|
||||
run();
|
||||
}
|
||||
module.exports = sendTelemetry;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue