Added bypassing spawn
This commit is contained in:
@@ -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 --
|
||||
------------------
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user