forked from haskell-github/github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEditTeam.hs
More file actions
23 lines (20 loc) · 792 Bytes
/
EditTeam.hs
File metadata and controls
23 lines (20 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import Common
import qualified GitHub
main :: IO ()
main = do
args <- getArgs
result <- case args of
[token, team_id, team_name, desc] ->
GitHub.github
(GitHub.OAuth $ fromString token)
GitHub.editTeamR
(GitHub.mkTeamId $ read team_id)
(GitHub.EditTeam (GitHub.mkTeamName $ fromString team_name) (Just $ fromString desc) GitHub.PermissionPull)
_ ->
error "usage: EditTeam <token> <team_id> <team_name> <description>"
case result of
Left err -> putStrLn $ "Error: " <> tshow err
Right team -> putStrLn $ tshow team