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

[EXE] cosmetics.

parent ca9f9baf
Pipeline #190 failed with stage
......@@ -44,40 +44,37 @@ instance ParseField Mode
instance ParseFields Mode
data MyOptions w = MyOptions { run :: w ::: Mode <?> "Possible modes: Dev | Mock | Prod"
, port :: w ::: Maybe Int <?> "By default: 8008"
, ini :: w ::: Maybe Text <?> "Ini-file path of gargantext.ini"
}
deriving (Generic)
data MyOptions w =
MyOptions { run :: w ::: Mode
<?> "Possible modes: Dev | Mock | Prod"
, port :: w ::: Maybe Int
<?> "By default: 8008"
, ini :: w ::: Maybe Text
<?> "Ini-file path of gargantext.ini"
}
deriving (Generic)
instance ParseRecord (MyOptions Wrapped)
deriving instance Show (MyOptions Unwrapped)
main :: IO ()
main = do
MyOptions myMode myPort myIniFile <- unwrapRecord
"Gargantext: collaborative platform for text-mining"
let myPort' = case myPort of
Just p -> p
Nothing -> 8008
let start = case myMode of
--Nothing -> startGargantext myPort' (unpack myIniFile')
Prod -> startGargantext myPort' (unpack myIniFile')
where
myIniFile' = case myIniFile of
Nothing -> panic "For Prod mode, you need to fill a gargantext.ini file"
Just i -> i
Mock -> startGargantextMock myPort'
_ -> startGargantextMock myPort'
putStrLn $ "Starting Gargantext with mode: " <> show myMode
start
-- main' :: IO ()
--main' = putStrLn $ show $ M.conditional $ M.myMat 10
main = do
MyOptions myMode myPort myIniFile <- unwrapRecord
"Gargantext server"
let myPort' = case myPort of
Just p -> p
Nothing -> 8008
let start = case myMode of
Prod -> startGargantext myPort' (unpack myIniFile')
where
myIniFile' = case myIniFile of
Nothing -> panic "[ERROR] gargantext.ini needed"
Just i -> i
_ -> startGargantextMock myPort'
putStrLn $ "Starting with " <> show myMode <> " mode."
start
......@@ -472,7 +472,7 @@ data Versioned a = Versioned
{ _v_version :: Version
, _v_data :: a
}
deriving (Generic)
deriving (Generic, Show)
deriveJSON (unPrefix "_v_") ''Versioned
makeLenses ''Versioned
instance ToSchema a => ToSchema (Versioned a)
......@@ -758,6 +758,6 @@ getTableNgrams _cId maybeTabType listIds mlimit moffset = do
limit_ = maybe defaultLimit identity mlimit
offset_ = maybe 0 identity moffset
getListNgrams listIds ngramsType
getListNgrams ([104] <> listIds) ngramsType
& mapped . v_data . _NgramsTable %~ (take limit_ . drop offset_)
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