CurryInfo: spicey-4.2.0 / Spicey.SpiceUp.createStructureWith

definition:
createStructureWith :: String -> String -> String -> IO ()
createStructureWith orgfile dbfile outdir = do
  -- set CURRYPATH in order to compile ERD model (which requires Database.ERD)
  unless (null packageLoadPath) $ setEnv "CURRYPATH" packageLoadPath
  -- The directory containing the resource files of the project generator:
  let resourcedir = packagePath </> "resource_files"
  exfile <- doesFileExist orgfile
  unless exfile $ error ("File '" ++ orgfile ++ "' does not exist!")
  unless (".curry"  `isSuffixOf` orgfile ||
          ".lcurry" `isSuffixOf` orgfile) $ do
     putStrLn $ "ERROR: '" ++ orgfile ++ "' is not a Curry program file!"
     exitWith 1
  erd <- readERDFromProgram orgfile
  let pkgname = erdName erd
      pkgdir  = if null outdir then pkgname else outdir
  createDirectoryIfMissing True pkgdir
  dbpath <- getAbsolutePath $ if null dbfile then pkgdir </> pkgname ++ ".db"
                                             else dbfile
  createStructure pkgdir resourcedir erd orgfile dbpath
                  (spiceyStructure pkgname)
  -- save original ERD specification in src/Model directory:
  copyFile orgfile
           (pkgdir </> "src" </> "Model" </> erdName erd ++ "_ERD.curry")
  putStrLn (helpText pkgname pkgdir dbpath)
 where
  helpText pkgname pkgdir dbpath = unlines $
    [ take 70 (repeat '-')
    , "Source files for the application generated as"
    , "Curry package '" ++ pkgname ++ "' in directory '" ++ pkgdir ++ "'."
    , ""
    , "The database is stored in:"
    ,  dbpath
    , ""
    , "If you want to store it at another place, move this file and change"
    , "the definition of 'sqliteDBFile' in 'src/Model/" ++ pkgname ++ ".curry'."
    , ""
    , "Please go into the package directory where the 'README.md' file"
    , "contains some hints how to install the generated application."
    , ""
    , "IMPORTANT NOTE:"
    , "Before you deploy your web application (by 'make deploy'),"
    , "you should define the variable WEBSERVERDIR in the Makefile!"
    ]
demand:
no demanded arguments
deterministic:
deterministic operation
failfree:
<FAILING>
indeterministic:
referentially transparent operation
infix:
no fixity defined
iotype:
{(_,_,_) |-> _}
name:
createStructureWith
precedence:
no precedence defined
result-values:
_
signature:
String -> String -> String -> Prelude.IO ()
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
possibly non-reducible on same data term