From a4ffe1ce62aded579cef12cd707378360e64e902 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Sun, 17 Jul 2011 18:38:59 +0200 Subject: Use filename:join/1 --- src/rebar.erl | 2 +- src/rebar_app_utils.erl | 4 ++-- src/rebar_templater.erl | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/rebar.erl b/src/rebar.erl index 797f71a..c0c6c97 100644 --- a/src/rebar.erl +++ b/src/rebar.erl @@ -99,7 +99,7 @@ run_aux(Commands) -> erlang:put(operations, 0), %% 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 true -> ?DEBUG("Load global config file ~p~n", diff --git a/src/rebar_app_utils.erl b/src/rebar_app_utils.erl index 7e6cbd9..b47520a 100644 --- a/src/rebar_app_utils.erl +++ b/src/rebar_app_utils.erl @@ -45,12 +45,12 @@ is_app_dir() -> is_app_dir(rebar_utils:get_cwd()). is_app_dir(Dir) -> - AppSrc = filename:join(Dir, "src/*.app.src"), + AppSrc = filename:join([Dir, "src", "*.app.src"]), case filelib:wildcard(AppSrc) of [AppSrcFile] -> {true, AppSrcFile}; _ -> - App = filename:join([Dir, "ebin/*.app"]), + App = filename:join([Dir, "ebin", "*.app"]), case filelib:wildcard(App) of [AppFile] -> {true, AppFile}; diff --git a/src/rebar_templater.erl b/src/rebar_templater.erl index 0bda300..865c8d5 100644 --- a/src/rebar_templater.erl +++ b/src/rebar_templater.erl @@ -200,8 +200,8 @@ find_escript_templates() -> find_disk_templates() -> OtherTemplates = find_other_templates(), - HomeFiles = rebar_utils:find_files(filename:join(os:getenv("HOME"), - ".rebar/templates"), + HomeFiles = rebar_utils:find_files(filename:join([os:getenv("HOME"), + ".rebar", "templates"]), ?TEMPLATE_RE), LocalFiles = rebar_utils:find_files(".", ?TEMPLATE_RE), [{file, F} || F <- OtherTemplates ++ HomeFiles ++ LocalFiles]. -- cgit v1.1