Skip to content

Commit

Permalink
Forward the profile list to the sub commands
Browse files Browse the repository at this point in the history
  • Loading branch information
sylane committed Oct 7, 2024
1 parent cb2b6c0 commit b04fecd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/rebar3_grisp_firmware.erl
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ get_bundle(RState, Refresh, RelName, RelVsn, ExtraRelArgs) ->

deploy_bundle(RState, Refresh, RelName, RelVsn, ExtraRelArgs) ->
Args = [
"as"
] ++ [
lists:join(",", [atom_to_list(P)
|| P <- rebar_state:current_profiles(RState)])
] ++ [
"grisp",
"deploy",
"--tar",
"--relname", atom_to_list(RelName),
"--relvsn", RelVsn,
Expand All @@ -183,7 +190,7 @@ deploy_bundle(RState, Refresh, RelName, RelVsn, ExtraRelArgs) ->
[_|_] -> ["--" | ExtraRelArgs];
_ -> []
end,
case rebar3:run(["grisp", "deploy" | Args]) of
case rebar3:run(Args) of
{error, _Reason} = Error -> Error;
{ok, _} -> {ok, RState}
end.
Expand Down
9 changes: 8 additions & 1 deletion src/rebar3_grisp_pack.erl
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ get_firmware(RState, Refresh, RelName, RelVsn, ExtraRelArgs) ->

build_firmwares(RState, WithBoot, Refresh, RelName, RelVsn, ExtraRelArgs) ->
Args = [
"as"
] ++ [
lists:join(",", [atom_to_list(P)
|| P <- rebar_state:current_profiles(RState)])
] ++ [
"grisp",
"firmware",
"--relname", atom_to_list(RelName),
"--relvsn", RelVsn,
"--force",
Expand All @@ -217,7 +224,7 @@ build_firmwares(RState, WithBoot, Refresh, RelName, RelVsn, ExtraRelArgs) ->
[_|_] -> ["--" | ExtraRelArgs];
_ -> []
end,
case rebar3:run(["grisp", "firmware" | Args]) of
case rebar3:run(Args) of
{error, _Reason} = Error -> Error;
{ok, _} -> {ok, RState}
end.
Expand Down
3 changes: 2 additions & 1 deletion src/rebar3_grisp_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ index_releases(Releases) ->

profile_postfix(RebarState) ->
AllProfiles = rebar_state:current_profiles(RebarState),
case [atom_to_binary(P) || P <- AllProfiles, P =/= default, P =/= grisp, P =/= test] of
case [atom_to_binary(P) || P <- AllProfiles,
P =/= default, P =/= grisp, P =/= test] of
[] -> <<"">>;
Profiles -> iolist_to_binary([".", lists:join($+, Profiles)])
end.

0 comments on commit b04fecd

Please sign in to comment.