1import System.Environment
3import Codec.Archive.Zip
4import qualified Data.ByteString.Lazy as BS
5import qualified Control.Exception as E
6import System.IO.Error (isDoesNotExistError)
9mkzip :: String -> IO ()
11 let dir = "data" </> fmt
12 output = "data" </> "reference" <.> fmt
13 cd <- getCurrentDirectory
14 setCurrentDirectory dir
15 archive <- addFilesToArchive [OptRecursive] emptyArchive ["."]
16 setCurrentDirectory cd
18 BS.writeFile output $ fromArchive archive
20removeIfExists :: FilePath -> IO ()
21removeIfExists fileName = removeFile fileName `E.catch` handleExists
23 | isDoesNotExistError e = return ()
24 | otherwise = E.throwIO e
27main = getArgs >>= mkzip . (!!0)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list