mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 19:03:47 +00:00
refactor: dev label
This commit is contained in:
committed by
Carlos Valente
parent
3056b75960
commit
2f65711078
@@ -0,0 +1,20 @@
|
||||
import { isProduction } from '../setup/index.js';
|
||||
import { consoleError } from '../utils/console.js';
|
||||
|
||||
/**
|
||||
* Milestone checker for dev environment
|
||||
* will terminate process if check returns true
|
||||
* Ideally we would like to remove the call to this function on build
|
||||
*/
|
||||
export function shouldCrashDev(check: boolean, reason: string) {
|
||||
if (isProduction) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!check) {
|
||||
return;
|
||||
}
|
||||
|
||||
consoleError(new Error(reason).stack ?? '');
|
||||
process.exit(2);
|
||||
}
|
||||
Reference in New Issue
Block a user