-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
32 lines (28 loc) · 850 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import ExecHandHistory from './src/playedhandhistory/mainCalculation';
import ExecTournamentHistory from './src/tournamentStatistics/mainCalculation';
const disableLoggingForBuildPhase = () => {
/**
* HIDE_LOGGING is undefined. It is only set true on building phase when script is tested
* When script is executed outside building phase HIDE_LOGGING is not set.
* More information on build.mjs file on project root
*/
if (process.env.HIDE_LOGGING === 'true') {
console.log = () => undefined;
}
};
/**
* Main entry point for executing statistics scripts
*/
const exec = () => {
disableLoggingForBuildPhase();
try {
ExecHandHistory();
ExecTournamentHistory();
} catch (e) {
console.error(
`Error on executing scripts, error message:
${e instanceof Error ? e.message : e}`
);
}
};
exec();