Added postbuild script.
parent
0d33e6d08f
commit
a249f0c6dc
|
@ -25,7 +25,7 @@
|
|||
"build-mysql-client": "dotenv prisma generate -- --schema=./prisma/schema.mysql.prisma",
|
||||
"build-postgresql-schema": "dotenv prisma db pull -- --schema=./prisma/schema.postgresql.prisma",
|
||||
"build-postgresql-client": "dotenv prisma generate -- --schema=./prisma/schema.postgresql.prisma",
|
||||
"postbuild": "node scripts/telemetry.js",
|
||||
"postbuild": "node scripts/postbuild.js",
|
||||
"copy-db-schema": "node scripts/copy-db-schema.js",
|
||||
"generate-lang": "npm-run-all extract-lang merge-lang",
|
||||
"extract-lang": "formatjs extract \"{pages,components}/**/*.js\" --out-file build/messages.json",
|
||||
|
|
|
@ -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…
Reference in New Issue