Skip to content

Commit

Permalink
Merge pull request #102 from membraneframework/fix/empty-command-call
Browse files Browse the repository at this point in the history
Fix shell error when running empty commands
  • Loading branch information
Qizot authored Nov 3, 2022
2 parents e497895 + 8b5acbc commit 74d3add
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/bundlex/build_script.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ defmodule Bundlex.BuildScript do
@moduledoc false

use Bunch

alias Bundlex.Platform

@script_ext unix: ".sh", windows: ".bat"
Expand All @@ -25,6 +26,12 @@ defmodule Bundlex.BuildScript do

@spec run(t, Platform.name_t()) ::
:ok | {:error, {:run_build_script, return_code: integer, command: String.t()}}
def run(script, platform)

def run(%__MODULE__{commands: []}, _platform) do
IO.warn("The list of commands is empty, did you forget to specify natives?")
end

def run(%__MODULE__{commands: commands}, platform) do
family = platform |> family!()
cmd = commands |> join_commands(family)
Expand Down

0 comments on commit 74d3add

Please sign in to comment.