Permalink
Browse files

/dev.erl

  • Loading branch information...
1 parent ac9136c commit 9dfa636ccc646e4e1b63d8ad9cf8fa07b2405be1 @astro committed Apr 7, 2012
Showing with 33 additions and 0 deletions.
  1. +33 −0 dev.erl
View
33 dev.erl
@@ -0,0 +1,33 @@
+-module(dev).
+
+-export([init/0, start_deps/0]).
+
+init() ->
+ R1 =
+ add_app_paths("deps") ++
+ add_app_paths("apps"),
+ R2 =
+ start_deps(),
+ R1 ++ R2.
+
+add_app_paths(BaseDir) ->
+ {ok, Filenames} = file:list_dir(BaseDir),
+ lists:map(fun("." ++ _) ->
+ ignore;
+ (Filename) ->
+ code:add_patha(BaseDir ++ "/" ++ Filename ++ "/ebin")
+ end, Filenames).
+
+start_deps() ->
+ R1 =
+ lists:map(
+ fun application:start/1,
+ [crypto, public_key, ssl, inets]),
+
+ {ok, Filenames} = file:list_dir("deps"),
+ R2 =
+ lists:map(
+ fun(Filename) ->
+ application:start(list_to_atom(Filename))
+ end, Filenames),
+ R1 ++ R2.

0 comments on commit 9dfa636

Please sign in to comment.