diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2015-04-08 23:08:18 +0200 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2015-04-08 23:08:18 +0200 |
commit | bad3a795c82d22ee968f166088fafd5a4b349ad6 (patch) | |
tree | d206d9853c11250e0a114d9ad19b293f31618ae0 /bootstrap | |
parent | b557e5fedcd95d9dc20ba1e0034b9bb7a6e41849 (diff) | |
download | rebar-bad3a795c82d22ee968f166088fafd5a4b349ad6.tar.gz |
Adapt to 18.x time api changes
Diffstat (limited to 'bootstrap')
-rwxr-xr-x | bootstrap | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -121,10 +121,21 @@ rm(Path) -> ok. build_time() -> - {{Y, M, D}, {H, Min, S}} = calendar:now_to_universal_time(now()), + {{Y, M, D}, {H, Min, S}} = calendar:now_to_universal_time(rebar_now()), lists:flatten(io_lib:format("~4..0w~2..0w~2..0w_~2..0w~2..0w~2..0w", [Y, M, D, H, Min, S])). +%% Even though we don't have -mode(compile), erl_lint:module/1 is run in +%% escript, so we still have to silence the deprecation warning. +-compile({nowarn_deprecated_function, [{erlang, now, 0}]}). +rebar_now() -> + case erlang:function_exported(erlang, timestamp, 0) of + true -> + erlang:timestamp(); + false -> + now() + end. + vcs_info([]) -> "No VCS info available."; vcs_info([{Id, Dir, VsnCmd, StatusCmd} | Rest]) -> |