-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstart.erl
More file actions
executable file
·35 lines (32 loc) · 831 Bytes
/
start.erl
File metadata and controls
executable file
·35 lines (32 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env escript
%% -*- erlang -*-
%%! -smp enable
%%%-------------------------------------------------------------------
%%% @author Adrianx Lau <adrianx.lau@gmail.com>
%%% @copyright (C) 2017,
%%% @doc
%%%
%%% @end
%%% Created : 12. 十月 2017 下午2:52
%%%-------------------------------------------------------------------
-module(start).
-author("Adrianx Lau <adrianx.lau@gmail.com>").
%% API
-export([main/1]).
main(_)->
code:add_path("ebin"),
Paths = filelib:wildcard("./deps/*/ebin"),
RunPath = code:get_path(),
lists:foreach(
fun(Path) ->
case lists:member(Path, RunPath) of
false -> true = code:add_path(Path);
true ->
ignor
end
end, Paths),
Cmd = "erl -pa ebin -s stockquery -config stockquery.config",
run(Cmd).
run(CmdLine)->
io:format("cmd:~s~n",[CmdLine]),
os:cmd(CmdLine).