Showing non-showcased batches in latest and upcoming, only meant to be excluded from new.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user