代码拉取完成,页面将自动刷新
#!/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])]).
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。