Skip to content
Browse files

support/cleanup: minor cleanup

  • Loading branch information...
1 parent 921d2b3 commit 9c62d602b5d6ae0f6f8c95d26fb4dc306015dfc1 @tuncer committed Nov 21, 2012
Showing with 7 additions and 8 deletions.
  1. +7 −8 support/getrebar
View
15 support/getrebar
@@ -2,14 +2,13 @@
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
-include_lib("kernel/include/file.hrl").
--author(tuncerayaz).
main(_) ->
case os:find_executable("rebar") of
false ->
start_apps(),
case obtain(bin) of
- {ok,Rebar} -> found(Rebar);
+ {ok, Rebar} -> found(Rebar);
_ -> halt(1)
end;
RebarInPATH -> found(RebarInPATH)
@@ -68,23 +67,23 @@ idelete(File) ->
end.
download(Url, File) ->
- HttpOpts = [{autoredirect,true}, {timeout, 30000}],
+ HttpOpts = [{autoredirect, true}, {timeout, 30000}],
Opts = [{stream, File}],
case httpc:request(get, {Url, []}, HttpOpts, Opts) of
{ok, saved_to_file} -> ok;
- {ok, {{_,_Code,_},_,_}} -> false;
- {ok, {_Code,_}} -> false;
+ {ok, {{_, _Code, _}, _, _}} -> false;
+ {ok, {_Code, _}} -> false;
_ -> false
end.
is_escript(File) ->
case filelib:is_regular(File) of
true ->
{ok, IOD} = file:open(File, [read]),
- Line0 = file:read_line(IOD),
+ Line = file:read_line(IOD),
ok = file:close(IOD),
- case Line0 of
- {ok,"#!/usr/bin/env escript\n"} -> true;
+ case Line of
+ {ok, "#!/usr/bin/env escript\n"} -> true;
_ -> false
end;
false -> false

0 comments on commit 9c62d60

Please sign in to comment.
Something went wrong with that request. Please try again.