Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

improve build output - add commands to output

  • Loading branch information...
commit 19fb18b33949796136c373f05d609699fab31d6a 1 parent a953149
@gleber gleber authored
Showing with 18 additions and 14 deletions.
  1. +18 −14 src/kha_builder.erl
View
32 src/kha_builder.erl
@@ -200,26 +200,30 @@ do_process({ProjectId, BuildId}) ->
ok = kha_git:clone(Remote, Local)
end,
- Steps = [ fun() ->
- ok = kha_git:checkout(Local, Branch),
- io_lib:format("git: Successfully checked out \"~s\" to \"~s\"~n", [Branch, Local])
- end |
- [ fun() ->
- kha_utils:sh(C, [{cd, Local}])
- end || C <- P#project.build ] ],
-
- BF = fun(C, B) ->
+ Steps = [ {"git clone and checkout",
+ fun() ->
+ ok = kha_git:checkout(Local, Branch),
+ io_lib:format("git: Successfully checked out \"~s\" to \"~s\"~n", [Branch, Local])
+ end} |
+ [ {C,
+ fun() ->
+ kha_utils:sh(C, [{cd, Local}])
+ end} || C <- P#project.build ] ],
+
+ BF = fun({Cmd, F}, B) ->
try
- D = C(),
- B2 = B#build{output = [D | B#build.output]},
+ B2 = B#build{output = [io_lib:format("$ ~s~n", [Cmd]) | B#build.output]},
kha_build:update(B2),
- B2
+ D = F(),
+ B3 = B#build{output = [D | B2#build.output]},
+ kha_build:update(B3),
+ B3
catch
throw:{exec_error, {_, ExitCode, Reason}} ->
- B3 = B#build{output = [Reason | B#build.output],
+ Be = B#build{output = [Reason | B#build.output],
exit = ExitCode,
status = failed},
- throw({error, B3})
+ throw({error, Be})
end
end,
Build2 = try
Please sign in to comment.
Something went wrong with that request. Please try again.