aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Install.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-31 02:34:03 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-31 02:34:03 -0400
commitacec36711090577752532a39f472e734e6b67fdb (patch)
tree6a3a5de0ec092e19c28464f4e2703fda9571b264 /Assistant/Install.hs
parent661eda766a8aa5c548ad89d8360bd4219eea138b (diff)
where indentation
Diffstat (limited to 'Assistant/Install.hs')
-rw-r--r--Assistant/Install.hs55
1 files changed, 27 insertions, 28 deletions
diff --git a/Assistant/Install.hs b/Assistant/Install.hs
index 1bf424cc9..635c265f4 100644
--- a/Assistant/Install.hs
+++ b/Assistant/Install.hs
@@ -36,36 +36,35 @@ standaloneAppBase = getEnv "GIT_ANNEX_APP_BASE"
-}
ensureInstalled :: IO ()
ensureInstalled = go =<< standaloneAppBase
- where
- go Nothing = noop
- go (Just base) = do
- let program = base ++ "runshell git-annex"
- programfile <- programFile
- createDirectoryIfMissing True (parentDir programfile)
- writeFile programfile program
+ where
+ go Nothing = noop
+ go (Just base) = do
+ let program = base ++ "runshell git-annex"
+ programfile <- programFile
+ createDirectoryIfMissing True (parentDir programfile)
+ writeFile programfile program
#ifdef darwin_HOST_OS
- autostartfile <- userAutoStart osxAutoStartLabel
+ autostartfile <- userAutoStart osxAutoStartLabel
#else
- autostartfile <- autoStartPath "git-annex"
- <$> userConfigDir
+ autostartfile <- autoStartPath "git-annex" <$> userConfigDir
#endif
- installAutoStart program autostartfile
+ installAutoStart program autostartfile
- {- This shim is only updated if it doesn't
- - already exist with the right content. This
- - ensures that there's no race where it would have
- - worked, but is unavailable due to being updated. -}
- sshdir <- sshDir
- let shim = sshdir </> "git-annex-shell"
- let content = unlines
- [ "#!/bin/sh"
- , "set -e"
- , "exec", base </> "runshell" ++
- " git-annex-shell -c \"$SSH_ORIGINAL_COMMAND\""
- ]
- curr <- catchDefaultIO "" $ readFileStrict shim
- when (curr /= content) $ do
- createDirectoryIfMissing True (parentDir shim)
- writeFile shim content
- modifyFileMode shim $ addModes [ownerExecuteMode]
+ {- This shim is only updated if it doesn't
+ - already exist with the right content. This
+ - ensures that there's no race where it would have
+ - worked, but is unavailable due to being updated. -}
+ sshdir <- sshDir
+ let shim = sshdir </> "git-annex-shell"
+ let content = unlines
+ [ "#!/bin/sh"
+ , "set -e"
+ , "exec", base </> "runshell" ++
+ " git-annex-shell -c \"$SSH_ORIGINAL_COMMAND\""
+ ]
+ curr <- catchDefaultIO "" $ readFileStrict shim
+ when (curr /= content) $ do
+ createDirectoryIfMissing True (parentDir shim)
+ writeFile shim content
+ modifyFileMode shim $ addModes [ownerExecuteMode]