aboutsummaryrefslogtreecommitdiff
path: root/Utility/FileMode.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-11-09 12:51:54 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-11-09 13:35:23 -0400
commitd8331995cd692d6b81895114e23dc7b1939fc6d1 (patch)
tree63a52a18b7a6b809c1262740cea491e347f0110f /Utility/FileMode.hs
parent164d9439a1f87c69aaa61f0314428ddfb68ee886 (diff)
use xmpp::user@host for xmpp remotes
Inject the required git-remote-xmpp into PATH when running xmpp git push. Rest of the time it will not be in PATH, and git won't be able to talk to xmpp remotes.
Diffstat (limited to 'Utility/FileMode.hs')
-rw-r--r--Utility/FileMode.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Utility/FileMode.hs b/Utility/FileMode.hs
index c742c690b..7109c1403 100644
--- a/Utility/FileMode.hs
+++ b/Utility/FileMode.hs
@@ -48,6 +48,9 @@ writeModes = [ownerWriteMode, groupWriteMode, otherWriteMode]
readModes :: [FileMode]
readModes = [ownerReadMode, groupReadMode, otherReadMode]
+executeModes :: [FileMode]
+executeModes = [ownerExecuteMode, groupExecuteMode, otherExecuteMode]
+
{- Removes the write bits from a file. -}
preventWrite :: FilePath -> IO ()
preventWrite f = modifyFileMode f $ removeModes writeModes
@@ -72,9 +75,7 @@ isSymLink = checkMode symbolicLinkMode
{- Checks if a file has any executable bits set. -}
isExecutable :: FileMode -> Bool
-isExecutable mode = combineModes ebits `intersectFileModes` mode /= 0
- where
- ebits = [ownerExecuteMode, groupExecuteMode, otherExecuteMode]
+isExecutable mode = combineModes executeModes `intersectFileModes` mode /= 0
{- Runs an action without that pesky umask influencing it, unless the
- passed FileMode is the standard one. -}