seems to work...

This commit is contained in:
Nox Sluijtman 2024-03-09 02:52:59 +01:00
parent 2fbde34568
commit 261d1c6264
3 changed files with 15 additions and 7 deletions

View file

@ -1,8 +1,10 @@
module Main where
import System.IO
import System.Directory
import Options.Applicative
import Data.List
import Control.Exception
data CgiState = CgiSuccess
instance Show CgiState where
@ -76,3 +78,9 @@ mkIndex True d f =
in do
line <- trim . words . head . lines <$> readFile path
putStrLn $ "=> " ++ path ++ " " ++ line
getFirstLine :: FilePath -> IO (Maybe String)
getFirstLine f = (Just <$> readFile f) `catch` handler
where
handler :: IOException -> IO (Maybe String)
handler _ = return Nothing

View file

@ -5,11 +5,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1689068808,
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1690753480,
"narHash": "sha256-GQgPs8fCh/LsyQoYMUZgT2p7jFVWyHu9p+1Nl/dp8GY=",
"lastModified": 1705273882,
"narHash": "sha256-68z5kaLaJ3fMWVwnknEKWypElq6Jzgtc9hddd14LhAo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9e06dd56947c1dc3dc837c3149bfe02c71a6edd7",
"rev": "5614bd58587f1337aca11d7b2bdfcca4ca44fccc",
"type": "github"
},
"original": {

View file

@ -67,7 +67,7 @@ executable twin
-- other-extensions:
-- Other library packages from which modules are imported.
build-depends: base ^>=4.16.4.0, directory, optparse-applicative
build-depends: base ^>=4.17.2.1, directory, optparse-applicative
-- Directories containing source files.
hs-source-dirs: app