diff --git a/src/lustre_dev_tools_ffi.erl b/src/lustre_dev_tools_ffi.erl index 658a7c4..a09e16a 100644 --- a/src/lustre_dev_tools_ffi.erl +++ b/src/lustre_dev_tools_ffi.erl @@ -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. @@ -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