-
-
Save bookshelfdave/2a1a666a8b70d590c688 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*- | |
%% ex: ts=4 sw=4 et | |
-module(user_default). | |
-compile(export_all). | |
-include("/srv/piab/mounts/oc_erchef/deps/chef_objects/include/chef_types.hrl"). | |
-include("/srv/piab/mounts/oc_erchef/deps/oc_chef_authz/include/oc_chef_authz.hrl"). | |
-include("/srv/piab/mounts/oc_erchef/deps/oc_chef_authz/include/oc_chef_types.hrl"). | |
%-include("/srv/piab/mounts/oc_erchef/deps/oc_chef_wm/include/oc_chef_wm.hrl"). | |
%-include("/srv/piab/mounts/oc_erchef/deps/chef_wm/include/chef_wm.hrl"). | |
kill_cleanup() -> | |
exit(whereis(oc_chef_authz_cleanup), die). | |
update_mod(Mod) -> | |
Info = Mod:module_info(), | |
CompileInfo = proplists:get_value(compile, Info), | |
Path = proplists:get_value(source, CompileInfo), | |
Options = [{d, 'BASE_RESOURCE', oc_chef_wm_base}, | |
{d, 'OC_CHEF'}, | |
{debug_info, debug_info}, | |
{d, 'BASE_ROUTES', oc_chef_wm_routes}, | |
{d,'CHEF_WM_DARKLAUNCH',xdarklaunch_req}, | |
{d,'CHEF_DB_DARKLAUNCH',xdarklaunch_req}, | |
{parse_transform,lager_transform}, | |
{i, "include"}, | |
{i, "/srv/piab/mounts/oc_erchef/deps/oc_chef_wm/include"}, | |
{i, "/srv/piab/mounts/oc_erchef/deps/chef_wm/include"}, | |
{i, "/srv/piab/mounts/oc_erchef/deps/chef_db/include"}, | |
{i, "/srv/piab/mounts/oc_erchef/deps/chef_objects/include"}, | |
{i, "/srv/piab/mounts/oc_erchef/deps/oc_chef_authz/include"}, | |
binary], | |
case compile:file(Path, Options) of | |
{ok, _Mod, Bin, Warnings} -> | |
reload(Mod, Path, Bin), | |
Warnings; | |
{ok, _Mod, Bin} -> | |
reload(Mod, Path, Bin), | |
ok; | |
Error -> | |
Error | |
end. | |
reload(Mod, Path, Binary) -> | |
code:delete(Mod), | |
code:purge(Mod), | |
code:load_binary(Mod, Path, Binary). | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you can build the beam with erlc, and drop it into /srv/piab/mount/oc_erchef/rel, then launch oc_erchef console from there and it wll pick it up. Once leaded you can update_mod(modified-mod-name) from the console