From f86145583a3a864287ff840e570d4576470006ab Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 6 Feb 2024 00:14:38 +1300 Subject: [PATCH] only use cli built-in error logging (#6) --- .changeset/slimy-humans-rhyme.md | 5 +++++ src/main.ts | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .changeset/slimy-humans-rhyme.md diff --git a/.changeset/slimy-humans-rhyme.md b/.changeset/slimy-humans-rhyme.md new file mode 100644 index 0000000..9425a37 --- /dev/null +++ b/.changeset/slimy-humans-rhyme.md @@ -0,0 +1,5 @@ +--- +"@effect/codemod": patch +--- + +only use cli built-in error logging diff --git a/src/main.ts b/src/main.ts index d0e999f..949e393 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,7 +4,6 @@ import * as Args from "@effect/cli/Args" import * as Command from "@effect/cli/Command" import * as Options from "@effect/cli/Options" import * as NodeContext from "@effect/platform-node/NodeContext" -import { runMain } from "@effect/platform-node/Runtime" import * as Console from "effect/Console" import * as Effect from "effect/Effect" import * as ReadonlyArray from "effect/ReadonlyArray" @@ -31,7 +30,7 @@ const codemod = Args.choice( Args.withDescription("The code modification to run"), ) -const run = Command.make("effect-codemod", { +const run = Command.make("codemod", { codemod, paths: Args.text({ name: "paths" }).pipe( Args.repeated, @@ -70,5 +69,5 @@ const run = Command.make("effect-codemod", { run(process.argv).pipe( Effect.provide(NodeContext.layer), Effect.tapDefect(Console.error), - runMain, + Effect.runFork, )