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 42ae29d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
runs-on: [ubuntu-22.04, windows-2022] # macos, for now, is best-effort
runs-on: [ubuntu-22.04] # macos, for now, is best-effort
otp-version: [24, 25, 26]
rebar3-version: [3.22]

Expand Down
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 42ae29d

Please sign in to comment.