Sina Samavati 11 лет назад
Родитель
Сommit
0c283ca17c
3 измененных файлов с 16 добавлено и 18 удалено
  1. 0 2
      src/mad.erl
  2. 8 8
      src/mad_deps.erl
  3. 8 8
      test/mad_deps_SUITE.erl

+ 0 - 2
src/mad.erl

@@ -6,8 +6,6 @@
 -export(['compile-app'/1]).
 -export(['compile-deps'/1]).
 
--include("mad.hrl").
-
 
 main([]) ->
     io:format("no args~n");

+ 8 - 8
src/mad_deps.erl

@@ -1,13 +1,13 @@
 -module(mad_deps).
 
--export([container/0]).
+-export([repos_path/0]).
 -export([path/2]).
 -export([clone/2]).
 -export([name_and_repo/1]).
 -export([checkout_to/1]).
 -export([get_publisher/1]).
 
--define(CONTAINER_PATH, filename:join([mad_utils:home(), ".mad", "container"])).
+-define(REPOS_PATH, filename:join([mad_utils:home(), ".mad", "repos"])).
 
 -type directory() :: string().
 -type name() :: atom().
@@ -17,15 +17,15 @@
 -type dependency() :: {name(), string(), repo()}.
 
 
--spec container() -> directory().
-container() ->
-    %% ~/.mad/container
-    ?CONTAINER_PATH.
+-spec repos_path() -> directory().
+repos_path() ->
+    %% ~/.mad/repos
+    ?REPOS_PATH.
 
 -spec path(string(), string()) -> directory().
 path(Publisher, Repo) ->
-    %% ~/.mad/container/X
-    filename:join([?CONTAINER_PATH, Publisher, Repo]).
+    %% ~/.mad/repos/Publisher/Repo
+    filename:join([?REPOS_PATH, Publisher, Repo]).
 
 -spec clone(directory(), [dependency()]) -> ok.
 clone(_, []) ->

+ 8 - 8
test/mad_deps_SUITE.erl

@@ -1,7 +1,7 @@
 -module(mad_deps_SUITE).
 
 -export([all/0]).
--export([container/1]).
+-export([repos_path/1]).
 -export([path/1]).
 -export([name_and_repo/1]).
 -export([checkout_to/1]).
@@ -12,14 +12,14 @@
 
 
 all() ->
-    [container, path, name_and_repo, checkout_to, get_publisher, clone].
+    [repos_path, path, name_and_repo, checkout_to, get_publisher, clone].
 
-container(_) ->
-    Path = filename:join([os:cmd("echo -n $HOME"), ".mad", "container"]),
-    Path = mad_deps:container().
+repos_path(_) ->
+    Path = filename:join([os:cmd("echo -n $HOME"), ".mad", "repos"]),
+    Path = mad_deps:repos_path().
 
 path(_) ->
-    Path = filename:join([os:cmd("echo -n $HOME"), ".mad", "container",
+    Path = filename:join([os:cmd("echo -n $HOME"), ".mad", "repos",
                           "publisher", "repo"]),
     Path = mad_deps:path("publisher", "repo").
 
@@ -40,8 +40,8 @@ clone(Config) ->
     DataDir = get_value(data_dir, Config),
     DepsDir = filename:join(DataDir, "deps"),
     os:cmd("rm -rf " ++ DepsDir),
-    %% make container and deps directories
-    os:cmd("mkdir -p " ++ mad_deps:container()),
+    %% make repos and deps directories
+    os:cmd("mkdir -p " ++ mad_deps:repos_path()),
     os:cmd("mkdir -p " ++ DepsDir),
     Deps = [{mad, ".*",
              {git, "git://github.com/s1n4/mad.git", {branch, "master"}}