Browse Source

Do not let check_edown halt a build if init:get_plain_arguments() is empty

This may happen in case if rebar is used as a library.
Vladimir Kirillov 11 years ago
parent
commit
4fcabb5c78
1 changed files with 5 additions and 1 deletions
  1. 5 1
      priv/check_edown.script

+ 5 - 1
priv/check_edown.script

@@ -4,7 +4,11 @@
 %% To build docs, call `rebar get-deps doc`
 %% To build docs, call `rebar get-deps doc`
 %% Assumes that the rebar config is bound to CONFIG
 %% Assumes that the rebar config is bound to CONFIG
 
 
-[_|Args] = init:get_plain_arguments().  % rebar 'commands' and options
+Args = case init:get_plain_arguments() of
+    [_|A] -> A;  % rebar 'commands' and options
+    _ -> []
+end.
+
 case lists:member("doc", Args) of
 case lists:member("doc", Args) of
     false ->
     false ->
 	{ok,C1} = file:script(filename:join(filename:dirname(SCRIPT),
 	{ok,C1} = file:script(filename:join(filename:dirname(SCRIPT),