make OUTPUT subdirs

Simplifies compute programs.
This commit is contained in:
Joey Hess 2025-03-07 14:57:12 -04:00
parent b4becb7167
commit 2c6dce83de
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 5 additions and 2 deletions

View file

@ -476,6 +476,11 @@ runComputeProgram (ComputeProgram program) state (ImmutableState immutablestate)
liftIO $ hPutStrLn (stdinHandle p) $
toCommand' (File f)
liftIO $ hFlush (stdinHandle p)
-- If the output file is in a subdirectory, make
-- the directories so the compute program doesn't
-- need to.
liftIO $ createDirectoryIfMissing True $
takeDirectory (subdir </> f')
knownoutput <- case M.lookup f' (computeOutputs $ computeState result) of
Nothing -> return False
Just mk -> do