summaryrefslogtreecommitdiff
path: root/Assistant
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-04-05 16:36:47 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-04-05 16:36:58 -0400
commitddf1fa7687fb989f3dd5a3fda7b3f0bf5d6d7e71 (patch)
tree90b2124ab1cd80b7a49697ac760cdfdb371b85ee /Assistant
parent754a231510284b5a2959442e5c8b5249866fcb18 (diff)
Fix nautilus script installation to not crash when the nautilus script dir does not exist. Instead, only install scripts when the directory already exists.
nautilus creates this directory each time run, so this avoids putting cruft in user's home
Diffstat (limited to 'Assistant')
-rw-r--r--Assistant/Install.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Assistant/Install.hs b/Assistant/Install.hs
index 4d02c0ece..883ca484c 100644
--- a/Assistant/Install.hs
+++ b/Assistant/Install.hs
@@ -87,8 +87,9 @@ installNautilus :: FilePath -> IO ()
#ifdef linux_HOST_OS
installNautilus program = do
scriptdir <- (\d -> d </> "nautilus" </> "scripts") <$> userDataDir
- genscript scriptdir "get"
- genscript scriptdir "drop"
+ whenM (doesDirectoryExist scriptdir) $ do
+ genscript scriptdir "get"
+ genscript scriptdir "drop"
where
genscript scriptdir action =
installscript (scriptdir </> scriptname action) $ unlines