Commit ea24887b authored by Alexandre Delanoë's avatar Alexandre Delanoë

[WIP] BIN import corpus CLI.

parent 441edde5
...@@ -40,6 +40,7 @@ library: ...@@ -40,6 +40,7 @@ library:
- Gargantext.Database.Schema.Node - Gargantext.Database.Schema.Node
- Gargantext.Database.Cooc - Gargantext.Database.Cooc
- Gargantext.Database.Tree - Gargantext.Database.Tree
- Gargantext.Database.Utils
- Gargantext.Prelude - Gargantext.Prelude
- Gargantext.Text - Gargantext.Text
- Gargantext.Text.Context - Gargantext.Text.Context
...@@ -48,6 +49,7 @@ library: ...@@ -48,6 +49,7 @@ library:
- Gargantext.Text.Metrics - Gargantext.Text.Metrics
- Gargantext.Text.Metrics.CharByChar - Gargantext.Text.Metrics.CharByChar
- Gargantext.Text.Metrics.Count - Gargantext.Text.Metrics.Count
- Gargantext.Text.Parsers
- Gargantext.Text.Parsers.CSV - Gargantext.Text.Parsers.CSV
- Gargantext.Text.Parsers.Date - Gargantext.Text.Parsers.Date
- Gargantext.Text.Parsers.Wikimedia - Gargantext.Text.Parsers.Wikimedia
...@@ -218,6 +220,20 @@ executables: ...@@ -218,6 +220,20 @@ executables:
- unordered-containers - unordered-containers
- full-text-search - full-text-search
gargantext-import:
main: Main.hs
source-dirs: bin/gargantext-import
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
- -O2
- -Wmissing-signatures
dependencies:
- gargantext
- base
- servant
tests: tests:
# garg-test: # garg-test:
# main: Main.hs # main: Main.hs
......
...@@ -73,11 +73,16 @@ runCmdDev f = do ...@@ -73,11 +73,16 @@ runCmdDev f = do
conn <- connectGargandb "gargantext.ini" conn <- connectGargandb "gargantext.ini"
either (fail . show) pure =<< runCmd conn f either (fail . show) pure =<< runCmd conn f
runCmdDev' :: Cmd ServantErr a -> IO a runCmdDevWith :: FilePath -> Cmd ServantErr a -> IO a
runCmdDev' f = do runCmdDevWith fp f = do
conn <- connectGargandb "gargantext.ini" conn <- connectGargandb fp
either (fail . show) pure =<< runCmd conn f either (fail . show) pure =<< runCmd conn f
runCmdDevWith' :: Cmd ServantErr a -> IO a
runCmdDevWith' f = runCmdDevWith "gargantext.ini" f
-- Use only for dev -- Use only for dev
runCmdDevNoErr :: Cmd () a -> IO a runCmdDevNoErr :: Cmd () a -> IO a
runCmdDevNoErr = runCmdDev runCmdDevNoErr = runCmdDev
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment