Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
160
Issues
160
List
Board
Labels
Milestones
Merge Requests
14
Merge Requests
14
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
54d8b9c9
Commit
54d8b9c9
authored
Jun 29, 2022
by
Karen Konou
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into 376-dev-annuaire-fields
parents
c81dacf7
65e99ec4
Pipeline
#2960
failed with stage
in 50 minutes and 13 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
Main.hs
bin/gargantext-invitations/Main.hs
+51
-0
No files found.
bin/gargantext-invitations/Main.hs
0 → 100644
View file @
54d8b9c9
{-|
Module : Main.hs
Description : GarganText Mailing Invitations
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
{-# LANGUAGE Strict #-}
module
Main
where
import
Data.Either
(
Either
(
..
))
import
Gargantext.API.Dev
(
withDevEnv
,
runCmdDev
)
import
Gargantext.API.Node
()
-- instances only
import
Gargantext.API.Prelude
(
GargError
)
import
Gargantext.Core.Types.Individu
(
User
(
..
),
arbitraryNewUsers
,
NewUser
(
..
),
arbitraryUsername
,
GargPassword
(
..
))
import
Gargantext.Database.Action.Flow
(
getOrMkRoot
,
getOrMk_RootWithCorpus
)
import
Gargantext.Database.Admin.Config
(
userMaster
,
corpusMasterName
)
import
Gargantext.Database.Admin.Trigger.Init
(
initFirstTriggers
,
initLastTriggers
)
import
Gargantext.Database.Admin.Types.Hyperdata
(
HyperdataCorpus
)
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Prelude
(
CmdR
)
import
Gargantext.Database.Query.Table.Node
(
getOrMkList
)
import
Gargantext.Database.Query.Table.User
(
insertNewUsers
,
)
import
Gargantext.Prelude
import
Gargantext.Prelude.Config
(
GargConfig
(
..
),
readConfig
)
import
Prelude
(
getLine
)
import
System.Environment
(
getArgs
)
import
Gargantext.Database.Action.User.New
(
newUsers
)
main
::
IO
()
main
=
do
params
@
[
iniPath
,
email
]
<-
getArgs
_
<-
if
length
params
/=
2
then
panic
"USAGE: ./gargantext-init gargantext.ini student@university.edu"
else
pure
()
cfg
<-
readConfig
iniPath
let
createUsers
::
CmdR
GargError
Int64
createUsers
=
newUsers
[
cs
email
]
withDevEnv
iniPath
$
\
env
->
do
_
<-
runCmdDev
env
createUsers
pure
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment