mirror of
https://github.com/correl/rebar.git
synced 2024-11-23 11:09:55 +00:00
deps: fix delete-deps if deps_dir ends with dot
Remove possible last dot from deps dir path by calling dirname on base_dir, deps_dir and dummy path part. With this fix delete-deps command deletes dependencies properly in case of deps dir path ended with dot. Examples of deps_dir config value that triggers error: ".", "some/path/.". Code that triggers error: rebar_deps:'delete-deps'/2, code line lists:prefix(DepsDir, D#dep.dir). If deps_dir = ".", cwd = "/root", dependency name = "app" then DepsDir = "/root/." and D#dep.dir = "/root/app" so prefix fun returns false but should be true. Dependency app will not be removed because of this.
This commit is contained in:
parent
c051530b3c
commit
703a9dae9e
1 changed files with 3 additions and 2 deletions
|
@ -307,8 +307,9 @@ get_deps_dir(Config) ->
|
|||
|
||||
get_deps_dir(Config, App) ->
|
||||
BaseDir = rebar_utils:base_dir(Config),
|
||||
DepsDir = get_shared_deps_dir(Config, "deps"),
|
||||
{true, filename:join([BaseDir, DepsDir, App])}.
|
||||
DepsDir0 = get_shared_deps_dir(Config, "deps"),
|
||||
DepsDir = filename:dirname(filename:join([BaseDir, DepsDir0, "dummy"])),
|
||||
{true, filename:join([DepsDir, App])}.
|
||||
|
||||
dep_dirs(Deps) ->
|
||||
[D#dep.dir || D <- Deps].
|
||||
|
|
Loading…
Reference in a new issue