Report error code on spawn
This commit is contained in:
+11
-7
@@ -101,15 +101,19 @@ package body Alire.OS_Lib is
|
|||||||
end;
|
end;
|
||||||
end loop;
|
end loop;
|
||||||
|
|
||||||
declare
|
|
||||||
Line : constant String := Ada.Characters.Latin_1.CR & Simple_Command & " completed";
|
|
||||||
begin
|
|
||||||
Max_Len := Natural'Max (Max_Len, Simple_Command'length + 2); -- If there weren't any output
|
|
||||||
Put_Line (Line & String'(1 .. Max_Len - Line'Length => ' '));
|
|
||||||
end;
|
|
||||||
|
|
||||||
return Code : Integer do
|
return Code : Integer do
|
||||||
Close (Pid, Code);
|
Close (Pid, Code);
|
||||||
|
|
||||||
|
declare
|
||||||
|
Line : constant String :=
|
||||||
|
Ada.Characters.Latin_1.CR & Simple_Command &
|
||||||
|
(if Code = 0
|
||||||
|
then " completed"
|
||||||
|
else " ended with error (exit code" & Code'Img & ")");
|
||||||
|
begin
|
||||||
|
Max_Len := Natural'Max (Max_Len, Simple_Command'length + 2); -- If there weren't any output
|
||||||
|
Put_Line (Line & String'(1 .. Max_Len - Line'Length => ' '));
|
||||||
|
end;
|
||||||
end return;
|
end return;
|
||||||
end Spawn_With_Progress;
|
end Spawn_With_Progress;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user