[commit: packages/directory] master: Update changelog and documentation (6b1a57c)
git at git.haskell.org
git at git.haskell.org
Fri Dec 18 09:52:26 UTC 2015
Repository : ssh://git@git.haskell.org/directory
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/6b1a57c7099c52516e877269dde961f3a85d9bc6/directory
>---------------------------------------------------------------
commit 6b1a57c7099c52516e877269dde961f3a85d9bc6
Author: Phil Ruffwind <rf at rufflewind.com>
Date: Fri Aug 28 00:40:54 2015 -0400
Update changelog and documentation
>---------------------------------------------------------------
6b1a57c7099c52516e877269dde961f3a85d9bc6
System/Directory.hs | 8 +++++++-
changelog.md | 7 +++++++
directory.cabal | 2 +-
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/System/Directory.hs b/System/Directory.hs
index adfa2fe..a1aa8fb 100644
--- a/System/Directory.hs
+++ b/System/Directory.hs
@@ -57,6 +57,7 @@ module System.Directory
, findFile
, findFiles
, findFilesWith
+ , exeExtension
-- * Existence tests
, doesFileExist
@@ -906,6 +907,10 @@ findExecutable fileName = do
-- | Given a file name, searches for the file and returns a list of all
-- occurences that are executable.
--
+-- On Windows, this only returns the first ocurrence, if any. It uses the
+-- @SearchPath@ from the Win32 API, so the caveats noted in 'findExecutable'
+-- apply here as well.
+--
-- @since 1.2.2.0
findExecutables :: String -> IO [FilePath]
findExecutables binary = do
@@ -919,6 +924,8 @@ findExecutables binary = do
-- | Given a file name, searches for the file on the given paths and returns a
-- list of all occurences that are executable.
+--
+-- @since 1.2.4.0
findExecutablesInDirectories :: [FilePath] -> String -> IO [FilePath]
findExecutablesInDirectories path binary =
findFilesWith isExecutable path (binary <.> exeExtension)
@@ -927,7 +934,6 @@ findExecutablesInDirectories path binary =
return $ executable perms
-- | Search through the given set of directories for the given file.
--- Used by 'findExecutable' on non-windows platforms.
findFile :: [FilePath] -> String -> IO (Maybe FilePath)
findFile path fileName = do
files <- findFiles path fileName
diff --git a/changelog.md b/changelog.md
index 10f12c9..85d26be 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,6 +1,13 @@
Changelog for the [`directory`][1] package
==========================================
+## 1.2.4.0 (September 2015)
+
+ * Add `findExecutablesInDirectories`
+ ([#33](https://github.com/haskell/directory/pull/33))
+
+ * Add `exeExtension`
+
## 1.2.3.2 (August 2015)
* Work around lack of `#const_str` when cross-compiling
diff --git a/directory.cabal b/directory.cabal
index 9300897..3ffb2ca 100644
--- a/directory.cabal
+++ b/directory.cabal
@@ -1,5 +1,5 @@
name: directory
-version: 1.2.3.2
+version: 1.2.4.0
-- NOTE: Don't forget to update ./changelog.md
license: BSD3
license-file: LICENSE
More information about the ghc-commits
mailing list