Created
June 1, 2018 21:58
-
-
Save dcoutts/98ed3665519390adbf9fad2a9523580d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cleanAction :: CleanFlags -> [String] -> GlobalFlags -> IO () | |
cleanAction cleanFlags extraArgs globalFlags = do | |
projectRootDir <- findProjectRoot | |
let DistDirLayout{distDirectory} = defaultDistDirLayout projectRootDir | |
notice verbosity "cleaning..." | |
-- Remove the whole shared dist dir | |
chattyTry "removing dist/" $ do | |
exists <- doesDirectoryExist distDirectory | |
when exists (removeDirectoryRecursive distDirectory) | |
-- Any extra files the user wants to remove | |
mapM_ removeFileOrDirectory (extraTmpFiles pkg_descr) | |
unless saveConfig $ do | |
-- Delete the cabal.project.local too | |
where | |
verbosity = fromFlagOrDefault normal (cleanVerbosity cleanFlags) | |
saveConfig = fromFlagOrDefault False (cleanSaveConf cleanFlags) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment