From 0efe0e1b3de9b62eb344c2bacd334f9e3ffed212 Mon Sep 17 00:00:00 2001 From: Tom Calloway Date: Thu, 9 Dec 2021 12:43:37 +0000 Subject: [PATCH] simplify build command logic by just removing optional argument --- lib/mix/tasks/compiler/gleam.ex | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/lib/mix/tasks/compiler/gleam.ex b/lib/mix/tasks/compiler/gleam.ex index 50da8ab..846d489 100644 --- a/lib/mix/tasks/compiler/gleam.ex +++ b/lib/mix/tasks/compiler/gleam.ex @@ -1,26 +1,10 @@ defmodule Mix.Tasks.Compile.Gleam do use Mix.Task.Compiler - @first_gleam_version_not_taking_build_arg "0.18.0-rc1" - def run(_args) do - case Mix.shell().cmd(build_command()) do + case Mix.shell().cmd("gleam build") do 0 -> {:ok, []} status -> exit(status) end end - - defp build_command do - if build_needs_arg?(), - do: "gleam build .", - else: "gleam build" - end - - defp build_needs_arg? do - {cmd_output, 0} = System.cmd("gleam", ["-V"]) - <<"gleam "::utf8, active_version::binary>> = String.trim(cmd_output) - - comparison = Version.compare(active_version, @first_gleam_version_not_taking_build_arg) - comparison == :lt - end end