From acb67b1d9ed668b965ec41983c5642127fd62b84 Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Mon, 8 Feb 2021 12:52:38 +0100 Subject: [PATCH] Fix problem when temp file doesn't exist (#686) --- src/alire/alire-directories.adb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/alire/alire-directories.adb b/src/alire/alire-directories.adb index 238afdfa..0d8830c7 100644 --- a/src/alire/alire-directories.adb +++ b/src/alire/alire-directories.adb @@ -354,7 +354,10 @@ package body Alire.Directories is -- Force writability of folder when in Windows, as some tools (e.g. git) -- that create read-only files will cause a Use_Error - if Kind (This.Filename) = Directory and then Platform.On_Windows then + if Exists (This.Filename) and then + Kind (This.Filename) = Directory and then + Platform.On_Windows + then Trace.Debug ("Forcing writability of temporary dir " & This.Filename); OS_Lib.Subprocess.Checked_Spawn ("attrib", -- 2.39.5