The output directory is now cleared when the program is ran.
This commit is contained in:
parent
a36de2bde1
commit
cd0f9dd456
2 changed files with 29 additions and 11 deletions
|
|
@ -14,7 +14,8 @@ import Data.List.Extra (isSuffixOf)
|
|||
import LambdaLifter (lambdaLift)
|
||||
import Renamer (rename)
|
||||
import System.Directory (createDirectory, doesPathExist,
|
||||
getDirectoryContents,
|
||||
getDirectoryContents, removeDirectory,
|
||||
removeDirectoryRecursive,
|
||||
setCurrentDirectory)
|
||||
import System.Environment (getArgs)
|
||||
import System.Exit (exitFailure, exitSuccess)
|
||||
|
|
@ -54,7 +55,8 @@ main' debug s = do
|
|||
--putStrLn compiled
|
||||
|
||||
check <- doesPathExist "output"
|
||||
unless check (createDirectory "output")
|
||||
when check (removeDirectoryRecursive "output")
|
||||
createDirectory "output"
|
||||
writeFile "output/llvm.ll" compiled
|
||||
if debug then debugDotViz else putStrLn compiled
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue