summaryrefslogtreecommitdiff
path: root/Biz/Dragons
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2021-12-07 14:22:18 -0500
committerBen Sima <ben@bsima.me>2021-12-07 14:22:18 -0500
commit7868cc248e01a36827338d8fca6b57f8999a1ba1 (patch)
tree4e132e3a5457f19ee0e414b281726680c88f417d /Biz/Dragons
parentab590a59b01ff26e691874968a9aba419aaf6882 (diff)
Add simple API key feature to Dragons.dev
Still need to add this to the CLI, and there should be other features like delete and so on, but this works for now.
Diffstat (limited to 'Biz/Dragons')
-rw-r--r--Biz/Dragons/Analysis.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/Biz/Dragons/Analysis.hs b/Biz/Dragons/Analysis.hs
index f1c1bbd..cfdbf2c 100644
--- a/Biz/Dragons/Analysis.hs
+++ b/Biz/Dragons/Analysis.hs
@@ -77,6 +77,8 @@ newtype Commit = Sha Text
instance Aeson.ToJSON Commit
+instance Aeson.FromJSON Commit
+
-- | The result of analyzing a git repo.
data Analysis = Analysis
{ -- | Where the repo is stored on the local disk.
@@ -105,6 +107,8 @@ data Analysis = Analysis
instance Aeson.ToJSON Analysis
+instance Aeson.FromJSON Analysis
+
run :: [Text] -> FilePath -> IO Analysis
run activeAuthors bareRepo = do
commit <- git bareRepo ["rev-parse", "HEAD"] /> Text.pack /> chomp /> Sha