Skip to content

Commit

Permalink
Prevent deprecation warnings from exporting an invalid image binary (#77
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jonatanklosko authored Apr 10, 2024
1 parent a89b17c commit 64c6a89
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/vega_lite/export.ex
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ defmodule VegaLite.Export do
{output, 0} ->
output

{output, code} ->
{_output, code} ->
raise RuntimeError, """
#{fn_name} requires #{command} executable from the vega-lite npm package.
Expand All @@ -217,19 +217,15 @@ defmodule VegaLite.Export do
# or in the current directory
npm install vega vega-lite canvas
npm exec failed with (#{code}):
#{output}
npm exec failed with code #{code}. Errors have been logged to standard error
"""
end
end

def run_cmd(script_path, args) do
opts = [stderr_to_stdout: true]

case :os.type() do
{:win32, _} -> System.cmd("cmd", ["/C", script_path | args], opts)
{_, _} -> System.cmd(script_path, args, opts)
{:win32, _} -> System.cmd("cmd", ["/C", script_path | args])
{_, _} -> System.cmd(script_path, args)
end
end
end

0 comments on commit 64c6a89

Please sign in to comment.