fix build in clean tree
authorJoey Hess <joeyh@joeyh.name>
Mon, 3 Aug 2020 23:43:21 +0000 (19:43 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 3 Aug 2020 23:43:21 +0000 (19:43 -0400)
removeDirectoryRecursive fails if the directory DNE.

Build/Standalone.hs

index f8c43242c2b9e1740485bde6f56473a10bfcc0d8..bc2a06208f5212e3f9701df0da25bfceb6955b0a 100644 (file)
@@ -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