From de716e18524355ad406fba34f99be07f5206dbbd Mon Sep 17 00:00:00 2001 From: Juhani Rankimies Date: Wed, 4 Aug 2010 11:07:37 +0300 Subject: [PATCH] fix get-deps on win32 --- src/rebar_deps.erl | 8 ++++---- src/rebar_utils.erl | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl index 5d6a890..8f1626a 100644 --- a/src/rebar_deps.erl +++ b/src/rebar_deps.erl @@ -314,12 +314,12 @@ required_scm_client_vsn(bzr) -> {2, 0}; required_scm_client_vsn(svn) -> {1, 6}. scm_client_vsn(hg) -> - scm_client_vsn(os:find_executable(hg), " --version", "version (\\d+).(\\d+)"); + scm_client_vsn(rebar_utils:find_executable(hg), " --version", "version (\\d+).(\\d+)"); scm_client_vsn(git) -> - scm_client_vsn(os:find_executable(git), " --version", "git version (\\d+).(\\d+)"); + scm_client_vsn(rebar_utils:find_executable(git), " --version", "git version (\\d+).(\\d+)"); scm_client_vsn(bzr) -> - scm_client_vsn(os:find_executable(bzr), " --version", "Bazaar \\(bzr\\) (\\d+).(\\d+)"); + scm_client_vsn(rebar_utils:find_executable(bzr), " --version", "Bazaar \\(bzr\\) (\\d+).(\\d+)"); scm_client_vsn(svn) -> - scm_client_vsn(os:find_executable(svn), " --version", "svn, version (\\d+).(\\d+)"); + scm_client_vsn(rebar_utils:find_executable(svn), " --version", "svn, version (\\d+).(\\d+)"); scm_client_vsn(_) -> undefined. diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index 1aecd2e..95981a3 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -38,7 +38,8 @@ beam_to_mod/2, beams/1, erl_to_mod/1, abort/2, - escript_foldl/3]). + escript_foldl/3, + find_executable/1]). -include("rebar.hrl"). @@ -125,6 +126,9 @@ escript_foldl(Fun, Acc, File) -> escript:foldl(Fun, Acc, File) end. +find_executable(Name) -> + "\"" ++ filename:nativename(os:find_executable(Name)) ++ "\"". + %% ==================================================================== %% Internal functions %% ====================================================================