CurryInfo: spicey-4.2.0 / Spicey.SpiceUp.createStructure

definition: Info
 
createStructure :: String -> String -> ERD -> String -> String -> DirTree
                -> IO ()
createStructure target_path resource_dir _ _ _
                (ResourceFile fmode filename) = do
  let infile     = resource_dir </> filename
      targetfile = target_path  </> takeFileName filename
  ifNotExistsDo targetfile $ do
    putStrLn $ "Creating file '" ++ targetfile ++ "'..."
    system $ "cp \"" ++ infile ++ "\" \"" ++ targetfile ++ "\""
    setFileMode fmode targetfile

createStructure target_path resource_dir erd _ _
                (ResourcePatchFile fmode filename patchfun) = do
  let full_path = target_path </> filename
  ifNotExistsDo full_path $ do
    putStrLn ("Creating file '" ++ full_path ++ "'...")
    cnt <- readFile (resource_dir </> filename)
    let outfile = target_path </> filename
    writeFile outfile (patchfun erd cnt)
    setFileMode fmode outfile

createStructure target_path resource_dir erd erprogpath db_path
                (Directory dirname subtree) = do
  let full_path = target_path </> dirname
  ifNotExistsDo full_path $ do
    putStrLn $ "Creating directory '" ++ full_path ++ "'..."
    createDirectory full_path
  mapM_ (createStructure full_path resource_dir erd erprogpath db_path) subtree

createStructure target_path _ erd erprogpath db_path
                (GeneratedFromERD generatorFunction) =
  generatorFunction erprogpath erd target_path db_path
demand: Info
 argument 6
deterministic: Info
 deterministic operation
documentation: Info
 
Creates the structure of the source files of the new package.
failfree: Info
 <FAILING>
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_,_,_,_,_,{ResourceFile}) |-> _ || (_,_,_,_,_,{ResourcePatchFile}) |-> _ || (_,_,_,_,_,{Directory}) |-> _ || (_,_,_,_,_,{GeneratedFromERD}) |-> _}
name: Info
 createStructure
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 String -> String -> Database.ERD.ERD -> String -> String -> DirTree
-> Prelude.IO ()
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 possibly non-reducible on same data term