membraneframework/bundlex

Bundlex raises on empty native list

pagmerek opened this issue · 0 comments

Description

When bundlex is invoked with empty native list then this function concatenate "\n" to the empty list.

  defp join_commands(commands, :unix) do
    Enum.map_join(commands, " && \\\n", &"(#{&1})") <> "\n"
  end

Since Elixir 1.14 Mix.shell().cmd("\n") throws an error resulting in compile error because it tries to run following script

#!/bin/sh
(
)

somehow in 1.13.4 this was not a problem

How to reproduce?

  1. Make sure you are using Elixir 1.14 or newer
  2. Initialize a project with empty native list
defmodule Example.BundlexProject do
  use Bundlex.Project

  def project() do
    [
      natives: []
    ]
  end
end
  1. Run mix compile
  2. Voila!