From 73c36138ffbca4851331878791156845047761d2 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Thu, 23 Apr 2020 15:56:48 +0000 Subject: [PATCH] Add version annotations to scripts This lets tools like mix figure out which version is in path without invoking rebar3 itself. --- bootstrap | 2 +- rebar.config | 1 + src/rebar.app.src | 2 +- src/rebar_prv_local_install.erl | 3 ++- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bootstrap b/bootstrap index b513e8ebd..9d257719f 100755 --- a/bootstrap +++ b/bootstrap @@ -35,7 +35,7 @@ main(_) -> bootstrap_rebar3(), %% Build rebar.app from rebar.app.src - {ok, App} = rebar_app_info:new(rebar, "3.13.0", filename:absname("_build/default/lib/rebar/")), + {ok, App} = rebar_app_info:new(rebar, "3.13.2", filename:absname("_build/default/lib/rebar/")), rebar_otp_app:compile(rebar_state:new(), App), %% Because we are compiling files that are loaded already we want to silence diff --git a/rebar.config b/rebar.config index f28a721ca..7fbaf9255 100644 --- a/rebar.config +++ b/rebar.config @@ -23,6 +23,7 @@ ]}. {escript_name, rebar3}. +{escript_comment, "%%Rebar3 3.13.2\n"}. {escript_emu_args, "%%! +sbtu +A1\n"}. %% escript_incl_extra is for internal rebar-private use only. %% Do not use outside rebar. Config interface is not stable. diff --git a/src/rebar.app.src b/src/rebar.app.src index c1fc12dda..e7bfc71a8 100644 --- a/src/rebar.app.src +++ b/src/rebar.app.src @@ -3,7 +3,7 @@ {application, rebar, [{description, "Rebar: Erlang Build Tool"}, - {vsn, "3.13.0"}, + {vsn, "3.13.2"}, {modules, []}, {registered, []}, {applications, [kernel, diff --git a/src/rebar_prv_local_install.erl b/src/rebar_prv_local_install.erl index cd6a20473..8b0ef48fa 100644 --- a/src/rebar_prv_local_install.erl +++ b/src/rebar_prv_local_install.erl @@ -62,8 +62,9 @@ format_error(Reason) -> io_lib:format("~p", [Reason]). bin_contents(OutputDir) -> + {ok, Vsn} = application:get_key(rebar, vsn), <<"#!/usr/bin/env sh - +## Rebar3 ", (iolist_to_binary(Vsn))/binary, " erl -pz ", (rebar_utils:to_binary(OutputDir))/binary,"/*/ebin +sbtu +A1 -noshell -boot start_clean -s rebar3 main $REBAR3_ERL_ARGS -extra \"$@\" ">>.