aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
blob: 2b3e95ebf87a1dad83bb9ed2a21d65d52f76a41b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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();