Skip to content

Commit

Permalink
remove unnecessary getCurrentDirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
bmillwood committed Sep 21, 2024
1 parent e545e1c commit 5a78cdf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions elm2nix/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import Data.Version (showVersion)
import Data.String.Here (hereLit)
import Options.Applicative
import System.IO
import System.Directory (getCurrentDirectory)
import qualified Elm2Nix
import qualified Paths_elm2nix as This
import qualified Text.PrettyPrint.ANSI.Leijen as PP
Expand All @@ -24,11 +23,10 @@ main = do
hSetBuffering stdout LineBuffering
hSetBuffering stderr LineBuffering
cmd <- getOpts
cwd <- getCurrentDirectory
case cmd of
Convert -> Elm2Nix.convert
Init -> Elm2Nix.initialize
Snapshot -> Elm2Nix.snapshot cwd
Snapshot -> Elm2Nix.snapshot

getOpts :: IO Command
getOpts = customExecParser p (infoH opts rest)
Expand Down
6 changes: 3 additions & 3 deletions src/Elm2Nix/PackagesSnapshot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ defHttpConfig = Req.defaultHttpConfig
defHttpConfig = def
#endif

snapshot :: String -> IO ()
snapshot dir = do
snapshot :: IO ()
snapshot = do
r <- Req.runReq defHttpConfig $
Req.req
Req.POST
Expand All @@ -154,7 +154,7 @@ snapshot dir = do
addEntry (KnownVersions _ vs) count =
count + 1 + length vs

Binary.encodeFile (dir </> "registry.dat") registry
Binary.encodeFile "registry.dat" registry

newtype Packages = Packages { unwrap :: Map.Map Name KnownVersions }

Expand Down

0 comments on commit 5a78cdf

Please sign in to comment.