Skip to content

Commit

Permalink
Use untracked version of doesDirectoryExist in GitClone
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1bo committed Nov 13, 2023
1 parent ac429cc commit 745c03c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Foliage/GitClone.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ module Foliage.GitClone (
)
where

import Development.Shake
import Development.Shake hiding (doesDirectoryExist)
import Development.Shake.Classes
import Development.Shake.FilePath
import Development.Shake.Rule
import Foliage.Meta (GitHubRepo)
import GHC.Generics (Generic)
import System.Directory (doesDirectoryExist)

newtype GitClone = GitClone {repo :: GitHubRepo}
deriving (Eq, Generic)
Expand Down Expand Up @@ -45,7 +46,7 @@ addGitCloneRule cacheDir = addBuiltinRule noLint noIdentity run
run GitClone{repo} _old _mode = do
let path = cacheDir </> "git" </> show repo

alreadyCloned <- doesDirectoryExist path
alreadyCloned <- liftIO $ doesDirectoryExist path
if alreadyCloned
then command_ [Cwd path] "git" ["fetch"]
else do
Expand Down

0 comments on commit 745c03c

Please sign in to comment.