Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (27 sloc) 968 Bytes
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Push
import Control.Exception.Safe
import Control.Monad
import Katip
import System.Environment
import System.IO
main :: IO ()
main = do
args <- getArgs
case args of
[vault, fp] -> main' vault fp
_ -> putStrLn "Usage: glacier-push-exe <vault> <filename>"
where
main' :: String -> FilePath -> IO ()
main' vault fp = do
handleScribe <- mkHandleScribe ColorIfTerminal stdout InfoS V2
let makeLogEnv = do e <- initLogEnv "glacier-push" "production"
registerScribe "stdout" handleScribe defaultScribeSettings e
initialContext = ()
initialNamespace = "main"
void $ bracket makeLogEnv closeScribes
$ \le -> runKatipContextT le initialContext initialNamespace
$ go vault fp