Files
stats/packages/db/code-migrations/helpers.ts
Carl-Gerhard Lindesvärd 42d0fb8572 fix self-hosting
2025-10-22 11:38:37 +02:00

33 lines
742 B
TypeScript

export function printBoxMessage(title: string, lines: (string | unknown)[]) {
console.log('┌──┐');
console.log('│');
if (title) {
console.log(`${title}`);
if (lines.length) {
console.log('│');
}
}
lines.forEach((line) => {
console.log(`${line}`);
});
console.log('│');
console.log('└──┘');
}
export function getIsCluster() {
const args = process.argv;
const noClusterArg = args.includes('--no-cluster');
if (noClusterArg) {
return false;
}
return !getIsSelfHosting();
}
export function getIsSelfHosting() {
return process.env.SELF_HOSTED === 'true' || !!process.env.SELF_HOSTED;
}
export function getIsDry() {
return process.argv.includes('--dry');
}