Skip to content

Commit

Permalink
merge upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
mihawk committed Apr 4, 2016
2 parents 03d00ad + 226d92c commit 5bab094
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/mad.hrl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-define(VERSION,"f3b8b4").
-define(VERSION,"9f2f1f").
4 changes: 2 additions & 2 deletions src/mad.erl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ help() -> info("MAD Container Tool version ~s~n",[?VERSION]),
info(" params = [] | command [ options ] params ~n"),
info(" command = app | deps | clean | compile | up~n"),
info(" | release [ beam | ling | script | runc | depot ]~n"),
info(" | deploy | start | stop | attach | sh ~n"),
info(" | create name=<name> tpl=<hello|bossdb> port=<port>~n"),
info(" | deploy | start | stop | attach | sh | static [ <watch|min> ] ~n"),
info(" | create name=<name> tpl=<basic|n2o|bossdb> port=<port>~n"),
return(false).
13 changes: 13 additions & 0 deletions src/mad_static.erl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
-compile(export_all).
-define(NODE(Bin), "node_modules/.bin/"++Bin).

main(Config, ["min"]) ->
{ok,[SysConfig]} = file:consult("sys.config"),
N2O = proplists:get_value(n2o,SysConfig,[]),
AppName = proplists:get_value(app,N2O,sample),
Minify = proplists:get_value(minify,N2O,[]),
Command = lists:concat(["uglifyjs ",string:join(element(2,Minify)," "),
" -o ",element(1,Minify),"/",AppName,".js -p 5 -c -m"]),
io:format("Minify: ~p~n",[Command]),
case sh:run(Command) of
{_,0,_} -> {ok,static};
{_,_,_} -> mad:info("minifyjs not installed. try `npm install -g uglify`~n"), {error,minifier}
end;

main(Config, ["watch"]) ->
case mad_utils:get_value(static, Config, []) of
[] -> {ok,static};
Expand Down
1 change: 1 addition & 0 deletions src/profile/mad_local.erl
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ deps(Params) -> mad_git:deps(Params).
up(Params) -> mad_git:up(Params).
fetch(Params) -> mad_git:fetch(Params).
tpl(Params) -> mad_tpl:app(Params).
static(Params) -> mad_static:main([],Params).

0 comments on commit 5bab094

Please sign in to comment.