forked from haskell-github/github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommon.hs
More file actions
29 lines (24 loc) · 653 Bytes
/
Common.hs
File metadata and controls
29 lines (24 loc) · 653 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{-# LANGUAGE NoImplicitPrelude #-}
module Common (
-- * Common stuff
getAuth,
tshow,
-- * Re-exports
putStrLn,
getArgs,
Proxy(..),
module GitHub.Internal.Prelude,
) where
import GitHub.Internal.Prelude hiding (putStrLn)
import Data.Proxy (Proxy (..))
import Data.Text.IO (putStrLn)
import System.Environment (lookupEnv)
import System.Environment (getArgs)
import qualified Data.Text as T
import qualified GitHub
getAuth :: IO (Maybe (GitHub.Auth))
getAuth = do
token <- lookupEnv "GITHUB_TOKEN"
pure (GitHub.OAuth . fromString <$> token)
tshow :: Show a => a -> Text
tshow = T.pack . show