make OUTPUT subdirs
Simplifies compute programs.
This commit is contained in:
parent
b4becb7167
commit
2c6dce83de
3 changed files with 5 additions and 2 deletions
|
@ -476,6 +476,11 @@ runComputeProgram (ComputeProgram program) state (ImmutableState immutablestate)
|
||||||
liftIO $ hPutStrLn (stdinHandle p) $
|
liftIO $ hPutStrLn (stdinHandle p) $
|
||||||
toCommand' (File f)
|
toCommand' (File f)
|
||||||
liftIO $ hFlush (stdinHandle p)
|
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
|
knownoutput <- case M.lookup f' (computeOutputs $ computeState result) of
|
||||||
Nothing -> return False
|
Nothing -> return False
|
||||||
Just mk -> do
|
Just mk -> do
|
||||||
|
|
|
@ -110,6 +110,5 @@ An example `git-annex-compute-foo` shell script follows:
|
||||||
echo REPRODUCIBLE
|
echo REPRODUCIBLE
|
||||||
|
|
||||||
if [ -n "$input" ]; then
|
if [ -n "$input" ]; then
|
||||||
mkdir -p "$(dirname "$output")"
|
|
||||||
frobnicate --passes="$ANNEX_COMPUTE_passes" <"$input" >"$output"
|
frobnicate --passes="$ANNEX_COMPUTE_passes" <"$input" >"$output"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -17,6 +17,5 @@ echo "OUTPUT $2"
|
||||||
read output
|
read output
|
||||||
|
|
||||||
if [ -n "$input" ]; then
|
if [ -n "$input" ]; then
|
||||||
mkdir -p "$(dirname "$output")"
|
|
||||||
convert "$input" "$output"
|
convert "$input" "$output"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue