Showing non-showcased batches in latest and upcoming, only meant to be excluded from new.

This commit is contained in:
2026-11-13 22:56:51 +01:00
parent 121d31d325
commit 3645c2a0e6
9 changed files with 37 additions and 10 deletions
+16
View File
@@ -1,8 +1,24 @@
import { realpathSync } from 'node:fs';
import process from 'node:process';
import { fileURLToPath } from 'node:url';
import { knexOwner as knex } from '../src/knex.js';
import redis from '../src/redis.js';
// whether the module was run directly rather than imported, a stand-in for import.meta.main, which needs node 24.2 or 22.18
export function isMain(moduleUrl) {
if (!process.argv[1]) {
return false;
}
try {
return realpathSync(process.argv[1]) === realpathSync(fileURLToPath(moduleUrl));
}
catch (_error) {
return false;
}
}
// runs a command line tool and closes the connections afterwards, the knex pool and redis would otherwise keep the process alive
export default async function runTool(tool) {
try {