Skip to content

Commit

Permalink
Add Windows alternatives
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Aug 21, 2023
1 parent 16b3a13 commit ee532b2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/alire/alire-directories.adb
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,16 @@ package body Alire.Directories is
Trace.Error ("Contents follow: ");
declare
use AAA.Strings;
use Platforms.Current;
Output : Vector;
Code : constant Integer :=
OS_Lib.Subprocess.Unchecked_Spawn_And_Capture
("ls", To_Vector ("-alRF"),
Output,
Err_To_Out => True);
Code : constant Integer :=
OS_Lib.Subprocess.Unchecked_Spawn_And_Capture
((if On_Windows then "dir" else "ls"),
(if On_Windows
then To_Vector ("/a") & "/b"
else To_Vector ("-alRF")),
Output,
Err_To_Out => True);
begin
if Code = 0 then
Trace.Error (Output.Flatten (New_Line));
Expand Down

0 comments on commit ee532b2

Please sign in to comment.