From bdfe6f7420f7822c8fe71433c08675b5a582b6e7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 3 Aug 2020 19:43:21 -0400 Subject: [PATCH] fix build in clean tree removeDirectoryRecursive fails if the directory DNE. --- Build/Standalone.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Build/Standalone.hs b/Build/Standalone.hs index f8c43242c2..bc2a06208f 100644 --- a/Build/Standalone.hs +++ b/Build/Standalone.hs @@ -155,12 +155,14 @@ installLocales topdir = cp "/usr/share/i18n" (topdir "i18n") installSkel :: FilePath -> FilePath -> IO () #ifdef darwin_HOST_OS installSkel topdir basedir = do - removeDirectoryRecursive basedir + whenM (doesDirectoryExist basedir) $ + removeDirectoryRecursive basedir unlessM (boolSystem "cp" [Param "-R", File "standalone/osx/git-annex.app", File basedir]) $ error "cp failed" #else installSkel topdir _basedir = do - removeDirectoryRecursive topdir + whenM (doesDirectoryExist topdir) $ + removeDirectoryRecursive topdir unlessM (boolSystem "cp" [Param "-R", File "standalone/linux/skel", File topdir]) $ error "cp failed" #endif