Skip to content

Commit

Permalink
Merge pull request #19 from juhp/ignore-files
Browse files Browse the repository at this point in the history
Directory: ignore non-directories (like .DS_Store files)
  • Loading branch information
juhp authored Dec 17, 2023
2 parents 1680862 + e2f57e4 commit 8a236b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Directories.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Directories (
)
where

import Control.Monad (forM_, unless, when)
import Control.Monad (filterM, forM_, unless, when)
import Data.List.Extra
import SimpleCmd ((+-+),
#if MIN_VERSION_simple_cmd(0,2,0)
Expand Down Expand Up @@ -71,7 +71,7 @@ traversePlatforms' getdir msystem act = do

listPlatforms :: Maybe String -> IO [FilePath]
listPlatforms msystem = do
platforms <- listDirectory "."
platforms <- listDirectory "." >>= filterM doesDirectoryExist
case msystem of
Nothing -> return platforms
Just s ->
Expand All @@ -83,7 +83,7 @@ listPlatforms msystem = do

listCurrentDirectory :: IO [FilePath]
listCurrentDirectory =
filter (\d -> head d /= '.') <$> listDirectory "."
filter (\d -> head d /= '.') <$> listDirectory "." >>= filterM doesDirectoryExist

Check warning on line 86 in src/Directories.hs

View workflow job for this annotation

GitHub Actions / Haskell GHC 9.8

In the use of ‘head’

#if !MIN_VERSION_simple_cmd(0,2,0)
warning :: String -> IO ()
Expand Down

0 comments on commit 8a236b9

Please sign in to comment.