Skip to content

Commit

Permalink
🔀 Correctly extract esbuild from tar on Windows.
Browse files Browse the repository at this point in the history
* fix windows esbuild issues

* change filepath based on windows OS
  • Loading branch information
Svaught598 authored Mar 29, 2024
1 parent c7efde2 commit 58d523e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/lustre_dev_tools_ffi.erl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ get_cpu() ->
list_to_binary(Arch);
{win32, _} ->
case erlang:system_info(wordsize) of
4 -> {ok, <<"ia32">>};
8 -> {ok, <<"x64">>}
4 -> <<"ia32">>;
8 -> <<"x64">>
end
end.

Expand All @@ -49,9 +49,15 @@ get_tailwind(Url) ->
end.

unzip_esbuild(Zip) ->
Filepath =
case os:type() of
{win32, _} -> "package/esbuild.exe";
_ -> "package/bin/esbuild"
end,

Result =
erl_tar:extract({binary, Zip}, [
memory, compressed, {files, ["package/bin/esbuild"]}
memory, compressed, {files, [Filepath]}
]),

case Result of
Expand Down

0 comments on commit 58d523e

Please sign in to comment.