From eaf66ceff82c3046f26c41d4f8c94245334e2d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Merle?= Date: Tue, 29 Oct 2024 15:16:14 +0100 Subject: [PATCH] Pass the profile list to the deploy command to be included in the manifest (#96) --- src/rebar3_grisp_deploy.erl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/rebar3_grisp_deploy.erl b/src/rebar3_grisp_deploy.erl index 0dffa83..7189ce5 100644 --- a/src/rebar3_grisp_deploy.erl +++ b/src/rebar3_grisp_deploy.erl @@ -87,6 +87,8 @@ do(RState) -> copy_dist_spec(RState, CopyDest, Force) ] end, + Profiles = [P || P <- rebar_state:current_profiles(RState), + P =/= default, P =/= grisp, P =/= test], DeploySpec = #{ project_root => ProjectRoot, apps => Apps, @@ -97,6 +99,7 @@ do(RState) -> release => #{ name => RelName, version => RelVsn, + profiles => Profiles, tar => Tar, force => Force }, @@ -295,6 +298,12 @@ event([deploy, distribute, copy, release, {copy, _Source, _Target}]) -> console("* Copying release..."); event([deploy, distribute, copy, files, {init, _Dest}]) -> console("* Copying files..."); +event([deploy, distribute, copy, files, {error, file_exists, Path}]) -> + RelPath = grisp_tools_util:maybe_relative(Path, ?MAX_DDOT), + abort( + "Destination ~s already exists (use --force to overwrite)", + [RelPath] + ); event([deploy, distribute, bundle, files, {init, _Dest}]) -> console("* Bundling files..."); event([deploy, distribute, _Name, files, {_, #{app := App, target := File}}]) ->