mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 03:00:17 +00:00
Use filename:join/1
This commit is contained in:
parent
734d30f96e
commit
a4ffe1ce62
3 changed files with 5 additions and 5 deletions
|
@ -99,7 +99,7 @@ run_aux(Commands) ->
|
||||||
erlang:put(operations, 0),
|
erlang:put(operations, 0),
|
||||||
|
|
||||||
%% If $HOME/.rebar/config exists load and use as global config
|
%% If $HOME/.rebar/config exists load and use as global config
|
||||||
GlobalConfigFile = filename:join(os:getenv("HOME"), ".rebar/config"),
|
GlobalConfigFile = filename:join([os:getenv("HOME"), ".rebar", "config"]),
|
||||||
GlobalConfig = case filelib:is_regular(GlobalConfigFile) of
|
GlobalConfig = case filelib:is_regular(GlobalConfigFile) of
|
||||||
true ->
|
true ->
|
||||||
?DEBUG("Load global config file ~p~n",
|
?DEBUG("Load global config file ~p~n",
|
||||||
|
|
|
@ -45,12 +45,12 @@ is_app_dir() ->
|
||||||
is_app_dir(rebar_utils:get_cwd()).
|
is_app_dir(rebar_utils:get_cwd()).
|
||||||
|
|
||||||
is_app_dir(Dir) ->
|
is_app_dir(Dir) ->
|
||||||
AppSrc = filename:join(Dir, "src/*.app.src"),
|
AppSrc = filename:join([Dir, "src", "*.app.src"]),
|
||||||
case filelib:wildcard(AppSrc) of
|
case filelib:wildcard(AppSrc) of
|
||||||
[AppSrcFile] ->
|
[AppSrcFile] ->
|
||||||
{true, AppSrcFile};
|
{true, AppSrcFile};
|
||||||
_ ->
|
_ ->
|
||||||
App = filename:join([Dir, "ebin/*.app"]),
|
App = filename:join([Dir, "ebin", "*.app"]),
|
||||||
case filelib:wildcard(App) of
|
case filelib:wildcard(App) of
|
||||||
[AppFile] ->
|
[AppFile] ->
|
||||||
{true, AppFile};
|
{true, AppFile};
|
||||||
|
|
|
@ -200,8 +200,8 @@ find_escript_templates() ->
|
||||||
|
|
||||||
find_disk_templates() ->
|
find_disk_templates() ->
|
||||||
OtherTemplates = find_other_templates(),
|
OtherTemplates = find_other_templates(),
|
||||||
HomeFiles = rebar_utils:find_files(filename:join(os:getenv("HOME"),
|
HomeFiles = rebar_utils:find_files(filename:join([os:getenv("HOME"),
|
||||||
".rebar/templates"),
|
".rebar", "templates"]),
|
||||||
?TEMPLATE_RE),
|
?TEMPLATE_RE),
|
||||||
LocalFiles = rebar_utils:find_files(".", ?TEMPLATE_RE),
|
LocalFiles = rebar_utils:find_files(".", ?TEMPLATE_RE),
|
||||||
[{file, F} || F <- OtherTemplates ++ HomeFiles ++ LocalFiles].
|
[{file, F} || F <- OtherTemplates ++ HomeFiles ++ LocalFiles].
|
||||||
|
|
Loading…
Reference in a new issue