Commit 8cc09392 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[REPL sugar] runCmdReplEasy

parent 18ef3d66
Pipeline #871 canceled with stage
...@@ -59,7 +59,6 @@ main = do ...@@ -59,7 +59,6 @@ main = do
annuaire :: forall m. FlowCmdM DevEnv GargError m => m CorpusId annuaire :: forall m. FlowCmdM DevEnv GargError m => m CorpusId
annuaire = flowAnnuaire (UserName $ cs user) (Left "Annuaire") (Multi EN) corpusPath annuaire = flowAnnuaire (UserName $ cs user) (Left "Annuaire") (Multi EN) corpusPath
{- {-
let debatCorpus :: forall m. FlowCmdM DevEnv GargError m => m CorpusId let debatCorpus :: forall m. FlowCmdM DevEnv GargError m => m CorpusId
debatCorpus = do debatCorpus = do
...@@ -84,7 +83,6 @@ main = do ...@@ -84,7 +83,6 @@ main = do
then runCmdDev env corpusCsvHal then runCmdDev env corpusCsvHal
else pure 0 --(cs "false") else pure 0 --(cs "false")
_ <- if fun == "annuaire" _ <- if fun == "annuaire"
then runCmdDev env annuaire then runCmdDev env annuaire
else pure 0 else pure 0
......
...@@ -318,6 +318,7 @@ withDevEnv iniPath k = do ...@@ -318,6 +318,7 @@ withDevEnv iniPath k = do
} }
-- | Run Cmd Sugar for the Repl (GHCI) -- | Run Cmd Sugar for the Repl (GHCI)
runCmdRepl :: Show err => Cmd' DevEnv err a -> IO a runCmdRepl :: Show err => Cmd' DevEnv err a -> IO a
runCmdRepl f = withDevEnv "gargantext.ini" $ \env -> runCmdDev env f runCmdRepl f = withDevEnv "gargantext.ini" $ \env -> runCmdDev env f
......
...@@ -106,7 +106,9 @@ type EnvC env = ...@@ -106,7 +106,9 @@ type EnvC env =
, HasJobEnv env ScraperStatus ScraperStatus , HasJobEnv env ScraperStatus ScraperStatus
) )
-------------------------------------------------------------------
runCmdReplEasy :: Cmd' DevEnv GargError a -> IO a
runCmdReplEasy f = withDevEnv "gargantext.ini" $ \env -> runCmdDev env f
------------------------------------------------------------------- -------------------------------------------------------------------
-- | This Type is needed to prepare the function before the GargServer -- | This Type is needed to prepare the function before the GargServer
......
...@@ -23,3 +23,6 @@ module Gargantext.Database ( module Gargantext.Database.Prelude ...@@ -23,3 +23,6 @@ module Gargantext.Database ( module Gargantext.Database.Prelude
import Gargantext.Database.Prelude (connectGargandb) import Gargantext.Database.Prelude (connectGargandb)
-- import Gargantext.Database.Bashql -- import Gargantext.Database.Bashql
...@@ -66,7 +66,6 @@ insertUsersDemo = do ...@@ -66,7 +66,6 @@ insertUsersDemo = do
insertUsers $ map (\(u,m,h) -> gargUserWith u m h) users insertUsers $ map (\(u,m,h) -> gargUserWith u m h) users
----------------------------------------------------------------------- -----------------------------------------------------------------------
gargUserWith :: Username -> Email -> Auth.PasswordHash Auth.Argon2 -> UserWrite gargUserWith :: Username -> Email -> Auth.PasswordHash Auth.Argon2 -> UserWrite
gargUserWith u m (Auth.PasswordHash p) = UserDB (Nothing) (pgStrictText p) gargUserWith u m (Auth.PasswordHash p) = UserDB (Nothing) (pgStrictText p)
(Nothing) (pgBool True) (pgStrictText u) (Nothing) (pgBool True) (pgStrictText u)
......
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