1 Star 16 Fork 5

EMQX / emqtt

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
pre-compile 800 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/env escript
-mode(compile).
main(_Args) ->
update_apps(os:getenv("WITH_WS")).
add_app(Apps, NewApp) ->
Apps ++ [NewApp].
del_app(Apps, OldApp) ->
Apps -- [OldApp].
update_apps("true") ->
do_update_apps(fun add_app/2);
update_apps(_false) ->
do_update_apps(fun del_app/2).
do_update_apps(Operator) ->
FilePath = filename:join(["src", "emqtt.app.src"]),
{ok, [{application, emqtt, PropLists0}]} = file:consult(FilePath),
Applications0 = proplists:get_value(applications, PropLists0),
Applications = Operator(Applications0, gun),
PropLists = [{applications, Applications} | proplists:delete(applications, PropLists0)],
NewAppSrc = {application, emqtt, PropLists},
ok = file:write_file(FilePath, [io_lib:format("~p.\n", [NewAppSrc])]).
Erlang
1
https://gitee.com/emqx/emqtt.git
git@gitee.com:emqx/emqtt.git
emqx
emqtt
emqtt
master

搜索帮助