From 89768057212ce7920fc8a3578d637d95889a6d1c Mon Sep 17 00:00:00 2001 From: Pomba Magar <11157420+pombadev@users.noreply.github.com> Date: Wed, 20 Sep 2023 13:15:57 +0545 Subject: [PATCH] remove nested if (#268) --- reduce.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/reduce.go b/reduce.go index f2e1c5e..b428ad6 100644 --- a/reduce.go +++ b/reduce.go @@ -24,14 +24,12 @@ func reduce(fns []string) { deno := false bin, err := exec.LookPath("node") if err != nil { + bin, err = exec.LookPath("deno") if err != nil { - bin, err = exec.LookPath("deno") - if err != nil { - _, _ = fmt.Fprintf(os.Stderr, "Node.js or Deno is required to run fx with reducers.\n") - os.Exit(1) - } - deno = true + _, _ = fmt.Fprintf(os.Stderr, "Node.js or Deno is required to run fx with reducers.\n") + os.Exit(1) } + deno = true } env := os.Environ()