Added bypassing spawn

This commit is contained in:
Jano at Zelda
2018-02-08 12:48:26 +01:00
parent a96a461810
commit c5247489a2
2 changed files with 19 additions and 0 deletions
+15
View File
@@ -177,6 +177,21 @@ package body Alire.OS_Lib is
end if;
end Spawn;
------------------
-- Spawn_Bypass --
------------------
procedure Spawn_Bypass (Command : String;
Arguments : String := "")
is
Code : constant Integer := Spawn (Locate_In_Path (Command),
Argument_String_To_List (Arguments).all);
begin
if Code /= 0 then
raise Program_Error with "Exit code:" & Code'Image;
end if;
end Spawn_Bypass;
------------------
-- Enter_Folder --
------------------
+4
View File
@@ -15,6 +15,10 @@ package Alire.OS_Lib is
Force_Quiet : Boolean := False);
-- Raises PROGRAM_ERROR if exit code /= 0
procedure Spawn_Bypass (Command : String;
Arguments : String := "");
-- Direct launch, without any shenanigangs on output, for example for respawning the canonical version
type Folder_Guard (<>) is limited private;
-- use this type in conjunction with Enter_Folder to ensure that
-- the CWD is modified and restored when creating/destroying the Folder_Guard