|
@ -52,21 +52,7 @@ main(_) -> |
|
|
rebar3:run(["escriptize"]), |
|
|
rebar3:run(["escriptize"]), |
|
|
|
|
|
|
|
|
%% Done with compile, can turn back on error logger |
|
|
%% Done with compile, can turn back on error logger |
|
|
error_logger:tty(true), |
|
|
|
|
|
|
|
|
|
|
|
%% Finally, update executable perms for our script on *nix, |
|
|
|
|
|
%% or write out script files on win32. |
|
|
|
|
|
ec_file:copy("_build/default/bin/rebar3", "./rebar3"), |
|
|
|
|
|
case os:type() of |
|
|
|
|
|
{unix,_} -> |
|
|
|
|
|
[] = os:cmd("chmod u+x rebar3"), |
|
|
|
|
|
ok; |
|
|
|
|
|
{win32,_} -> |
|
|
|
|
|
write_windows_scripts(), |
|
|
|
|
|
ok; |
|
|
|
|
|
_ -> |
|
|
|
|
|
ok |
|
|
|
|
|
end. |
|
|
|
|
|
|
|
|
error_logger:tty(true). |
|
|
|
|
|
|
|
|
default_registry_file() -> |
|
|
default_registry_file() -> |
|
|
{ok, [[Home]]} = init:get_argument(home), |
|
|
{ok, [[Home]]} = init:get_argument(home), |
|
@ -305,14 +291,6 @@ reset_env() -> |
|
|
application:unload(rebar), |
|
|
application:unload(rebar), |
|
|
application:load(rebar). |
|
|
application:load(rebar). |
|
|
|
|
|
|
|
|
write_windows_scripts() -> |
|
|
|
|
|
CmdScript= |
|
|
|
|
|
"@echo off\r\n" |
|
|
|
|
|
"setlocal\r\n" |
|
|
|
|
|
"set rebarscript=%~f0\r\n" |
|
|
|
|
|
"escript.exe \"%rebarscript:.cmd=%\" %*\r\n", |
|
|
|
|
|
ok = file:write_file("rebar3.cmd", CmdScript). |
|
|
|
|
|
|
|
|
|
|
|
get_deps() -> |
|
|
get_deps() -> |
|
|
case file:consult("rebar.lock") of |
|
|
case file:consult("rebar.lock") of |
|
|
{ok, [[]]} -> |
|
|
{ok, [[]]} -> |
|
|