Skip to content

Commit 58d523e

Browse files
authored
🔀 Correctly extract esbuild from tar on Windows.
* fix windows esbuild issues * change filepath based on windows OS
1 parent c7efde2 commit 58d523e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/lustre_dev_tools_ffi.erl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ get_cpu() ->
2323
list_to_binary(Arch);
2424
{win32, _} ->
2525
case erlang:system_info(wordsize) of
26-
4 -> {ok, <<"ia32">>};
27-
8 -> {ok, <<"x64">>}
26+
4 -> <<"ia32">>;
27+
8 -> <<"x64">>
2828
end
2929
end.
3030

@@ -49,9 +49,15 @@ get_tailwind(Url) ->
4949
end.
5050

5151
unzip_esbuild(Zip) ->
52+
Filepath =
53+
case os:type() of
54+
{win32, _} -> "package/esbuild.exe";
55+
_ -> "package/bin/esbuild"
56+
end,
57+
5258
Result =
5359
erl_tar:extract({binary, Zip}, [
54-
memory, compressed, {files, ["package/bin/esbuild"]}
60+
memory, compressed, {files, [Filepath]}
5561
]),
5662

5763
case Result of

0 commit comments

Comments
 (0)