diff options
Diffstat (limited to 'app/Main.hs')
-rw-r--r-- | app/Main.hs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/app/Main.hs b/app/Main.hs index 47f0280..bb8947d 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -12,11 +12,8 @@ import Data.ByteString.Lazy.Char8 qualified as LB import Data.List (foldl', isSuffixOf) import Data.Maybe (fromMaybe, mapMaybe) import Data.Set qualified as S -import Data.String (IsString (fromString)) -import Data.Tagged (Tagged (Tagged)) import Data.Text qualified as T import Debug.Trace (trace) -import Git import Store qualified as S import System.Directory (setCurrentDirectory) import System.FilePath ((</>)) @@ -146,9 +143,7 @@ query (Select fs c js ws) = do where ls c = filter (not . (isSuffixOf "/")) - <$> S.withStore "." do - Just cid <- fmap Tagged <$> resolveReference "HEAD" - S.listDirectory cid c + <$> S.withStore "." "HEAD" (S.listDirectory c) combine :: [Record J.Value] -> [Join [Record J.Value]] -> [[Record J.Value]] combine vs js = combine' (map (: []) vs) js @@ -197,9 +192,9 @@ data DecodeException = DecodeException instance Exception DecodeException decodeFile :: J.FromJSON a => FilePath -> IO a -decodeFile fp = S.withStore "." do - Just cid <- fmap Tagged <$> resolveReference "HEAD" - fromMaybe (throw DecodeException) . J.decode <$> S.readFile cid fp +decodeFile fp = + S.withStore "." "HEAD" $ + fromMaybe (throw DecodeException) . J.decode <$> S.readFile fp select :: FieldSelector -> [Record J.Value] -> J.Value select All vs = |