CurryInfo: spicey-4.2.0 / Spicey.SpiceUp.createStructureWith

definition: Info
 
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: Info
 no demanded arguments
deterministic: Info
 deterministic operation
failfree: Info
 <FAILING>
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_,_,_) |-> _}
name: Info
 createStructureWith
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 String -> String -> String -> 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