uptime/src/index.ts

17 lines
477 B
TypeScript

import * as TE from "fp-ts/lib/TaskEither";
import { pipe } from "fp-ts/lib/function";
import { toError } from "fp-ts/lib/Either";
import { readConfig } from "./config";
import { parseArgs } from "./args";
const main: TE.TaskEither<Error, void> = pipe(
TE.fromEither(parseArgs(Bun.argv)),
TE.bindTo("args"),
TE.bind("config", ({ args }) => TE.fromIO(readConfig(args.testsFile))),
TE.fold(
(e) => TE.left(toError(e)),
() => TE.right(undefined),
),
);
main();