File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
hnix-store-nar/src/System/Nix/Nar Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ streamStringOutIO
8888streamStringOutIO f executable getChunk =
8989 Exception.Lifted. bracket
9090 (liftIO $ IO. openFile f WriteMode )
91- (liftIO . IO. hClose)
91+ (\ h -> liftIO (updateExecutablePermissions >> IO. hClose h) )
9292 go
9393 `Exception.Lifted.catch`
9494 cleanupException
@@ -100,10 +100,11 @@ streamStringOutIO f executable getChunk =
100100 Nothing -> pure ()
101101 Just c -> do
102102 liftIO $ Data.ByteString. hPut handle c
103- Control.Monad. when (executable == Executable ) $ liftIO $ do
104- p <- Directory. getPermissions f
105- Directory. setPermissions f (p { Directory. executable = True })
106103 go handle
104+ updateExecutablePermissions =
105+ Control.Monad. when (executable == Executable ) $ do
106+ p <- Directory. getPermissions f
107+ Directory. setPermissions f (p { Directory. executable = True })
107108 cleanupException (e :: Exception.Lifted. SomeException ) = do
108109 liftIO $ Directory. removeFile f
109110 Control.Monad. fail $
You can’t perform that action at this time.
0 commit comments