I'm trying to migrate an existing makefile to Shake and so far I've tried the following (just create a file with the content of a directory)
module Main where
import Development.Shake
main :: IO ()
main = shakeArgs shakeOptions{shakeFiles="_build"} $ do
let ls = "_build/ls.txt"
want [ls]
ls *> \out -> do
cmd "ls > " out
When I run it, I get the following error message :
> runghc test.hs _build/ls.txt
# ls (for _build/ls.txt)
ls: >: No such file or directory
ls: _build/ls.txt: No such file or directory
Error when running Shake build system:
* _build/ls.txt
Development.Shake.cmd, system command failed
Command: ls > _build/ls.txt
Exit code: 1
Stderr:
ls: >: No such file or directory
ls: _build/ls.txt: No such file or directory
What Am I doing wrong? How do you execute a sh
command and redirect its output?