def makeAppComponents()

in src/main/scala/com/adamnfish/eek/Main.scala [95:128]


  def makeAppComponents(args: Args): Resource[IO, AppComponents[IO]] =
    given LoggerFactory[IO] = Slf4jFactory.create[IO]
    for {
      githubApis: SourceCode[IO] <-
        args.sourceCodeArgs match
          case SourceCodeArgs.GitHubArgs(owner, repo, gitRef) =>
            Github.create[IO](owner, repo, gitRef)
          case SourceCodeArgs.FilesystemArgs(path) =>
            Resource.pure(new Filesystem[IO](path.getAbsolutePath))
          case SourceCodeArgs.SourceCodeArgsNotSpecified =>
            IO.raiseError(
              new RuntimeException(
                "Unexpected state - no source code provided"
              )
            ).toResource

      docsEvaluator <-
        args.docsEvaluatorArgs match
          case DocsEvaluatorArgs.AwsBedrockArgs(profile, region) =>
            AwsBedrockDocsEvaluator.create[IO](profile, Region.of(region))
          case DocsEvaluatorArgs.DocsEvaluatorArgsNotSpecified =>
            IO.raiseError(
              new RuntimeException(
                "Unexpected state - no documentation evaluator specified"
              )
            ).toResource

      printer <-
        args.outputArgs match
          case OutputArgs.ConsoleOutputArgs =>
            Resource.pure(ConsolePrinter[IO])
          case OutputArgs.MarkdownFileOutputArgs(file) =>
            MarkdownFilePrinter[IO](file)
    } yield AppComponents[IO](