3 Description : Gargantext Import Corpus
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
10 Import a corpus binary.
14 {-# LANGUAGE Strict #-}
18 import Gargantext.API.Admin.EnvTypes (DevEnv)
19 import Gargantext.API.Dev (withDevEnv, runCmdDev)
20 import Gargantext.API.Prelude (GargError)
21 import Gargantext.API.Node () -- instances only
22 import Gargantext.API.Ngrams.Tools (getRepo)
23 import Gargantext.Database.Prelude (Cmd'', )
24 import Gargantext.Core.NodeStory
25 import Gargantext.Prelude
26 import Gargantext.Prelude.Config (GargConfig(..), readConfig)
27 import System.Environment (getArgs)
28 import Prelude (getLine)
29 import GHC.IO.Exception (IOException)
34 putStrLn "Manual method:"
35 putStrLn "Upgrade your GarganText instance with the script:"
36 putStrLn "Then press enter key to launch upgrade."
40 cfg <- readConfig iniPath
43 -- upgrade :: Cmd'' DevEnv GargError ()
44 upgrade :: Cmd'' DevEnv IOException ()
46 let repo_filepath = _gc_repofilepath cfg
48 _ <- liftBase $ repoMigration repo_filepath repo
52 withDevEnv iniPath $ \env -> do
53 _ <- runCmdDev env upgrade
54 putStrLn "Uprade done with success"