Skip to content

Commit

Permalink
Remove Windows support, for now
Browse files Browse the repository at this point in the history
Something's wrong with the ports, it's late and I need some rest!
  • Loading branch information
paulo-ferraz-oliveira committed Jul 13, 2023
1 parent fd2848d commit 4140576
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/rebar3_checkshell_arch.erl
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,20 @@ do({true = _IsMacOS, false = _IsLinux, false = _IsWindows}, Files, State) ->
execute(darwin, Files, State);
do({false = _IsMacOS, true = _IsLinux, false = _IsWindows}, Files, State) ->
execute(linux, Files, State);
do({false = _IsMacOS, false = _IsLinux, true = _IsWindows}, Files, State) ->
execute(windows, Files, State).
do({false = _IsMacOS, false = _IsLinux, true = _IsWindows}, _Files, _State) ->
{error, "checkshell: no support for Windows yet"}.

-spec execute(Arch, Files, State) -> Result when
Arch :: darwin | linux | windows,
Arch :: darwin | linux,
Files :: string(),
Result :: {ok, State} | {error, rebar3_checkshell_utils:str()}.
execute(Arch, Files, State) ->
ArchDir = filename:join(rebar3_checkshell_utils:priv_dir(), atom_to_list(Arch) ++ ".x86_64"),
Ext = extension_for(Arch),
Exec = filename:join(ArchDir, "shellcheck" ++ Ext),
Exec = filename:join(ArchDir, "shellcheck"),
OpenPortCmd = {spawn, Exec ++ args(Files, State)},
OpenPortOpts = [exit_status],
result(port_loop(erlang:open_port(OpenPortCmd, OpenPortOpts), ""), State).

-spec extension_for(Arch) -> Ext when
Arch :: darwin | linux | windows,
Ext :: rebar3_checkshell_utils:str().
extension_for(windows) ->
".exe";
extension_for(_Other) ->
"".

-spec result({ExitCode, Analysis}, State) -> Result when
ExitCode :: non_neg_integer(),
Analysis :: string(),
Expand Down

0 comments on commit 4140576

Please sign in to comment.