Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent deprecation warnings from exporting an invalid image binary #77

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading