1 Star 16 Fork 6

EMQX/emqtt

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
pre-compile 800 Bytes
一键复制 编辑 原始数据 按行查看 历史
王健博 提交于 2019-07-26 11:10 +08:00 . Make gun-dep dynamic even emqtt as dependency
#!/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])]).
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Erlang
1
https://gitee.com/emqx/emqtt.git
git@gitee.com:emqx/emqtt.git
emqx
emqtt
emqtt
master

搜索帮助