stack-clean-old 0.3 → 0.3.1
raw patch · 6 files changed
+26/−12 lines, 6 files
Files
- ChangeLog.md +4/−1
- README.md +16/−6
- src/Directories.hs +1/−1
- src/GHC.hs +1/−1
- src/Snapshots.hs +2/−1
- stack-clean-old.cabal +2/−2
ChangeLog.md view
@@ -1,4 +1,7 @@-# Revision history for stack-clean-old-work+# Release history for stack-clean-old-work++## 0.3.1 (2021-08-01)+- 'delete-work': use find -prune and ignore inaccessible files (@petrem, #4) ## 0.3 (2021-01-08) - drop subsubcommands to simplify UI
README.md view
@@ -5,7 +5,7 @@ ## Usage ```-stack-clean-old [size|list|remove|keep-minor] [(-p|--project) | (-g|--ghc)] [GHCVER]+stack-clean-old [size|list|remove|keep-minor|purge-older|delete-work] [(-p|--project) | (-g|--ghc)] [GHCVER] ``` Options: @@ -29,11 +29,16 @@ removes the builds/installs for previous minor ghc versions. If GHCVER is given then only minor versions older than it are removed. -If you remove any needed snapshot builds for a version of ghc, then you would have to rebuild them again for any projects still using them, so removal should be used cautiously, but it can recover a lot of diskspace.+`purge-older` and `delete-work`:+ see sections below -NBB: All the command support `--dry-run` (`-n`) so you can check the effect-of running them safely beforehand.+If you remove any needed snapshot builds for a version of ghc,+then you would have to rebuild them again for any projects still using them,+so removal should be used cautiously, but it can recover a lot of diskspace. +NBB: All the command support `--dry-run` (`-n`), so please use it to+check the effect of running them safely beforehand.+ ### Example usage To remove project builds for ghc-8.2.2: ```@@ -71,8 +76,13 @@ NB: If you regularly build your project for several branches/tags against the same LTS or ghc version then it is safer to avoid using `purge-older`. -Also `stack-clean-old delete-work` can be used to recursively remove-_all_ `.stack-work/` dirs from a project to save space (seems same as `stack clean --full`).+### Deleting all `.stack-work/` subdirectories+`stack-clean-old delete-work` can be used to recursively remove+_all_ `.stack-work/` dirs from a project to save space+(seems same as `stack clean --full`).++`stack-clean-old delete-work --all` works from outside stack projects:+please test with `--dry-run` first. ## Installation
src/Directories.hs view
@@ -25,7 +25,7 @@ switchToSystemDirUnder dir = do ifM (doesDirectoryExist dir) (setCurrentDirectory dir)- (error' $ dir ++ "not found")+ (error' $ dir ++ " not found") systems <- listDirectory "." -- FIXME be more precise/check "system" dirs -- eg 64bit intel Linux: x86_64-linux-tinfo6
src/GHC.hs view
@@ -78,4 +78,4 @@ doRemoveGhcVersion dryrun ghcinst = do Remove.doRemoveDirectory dryrun ghcinst Remove.removeFile dryrun (ghcinst <.> "installed")- putStrLn $ ghcinst ++ "compiler " ++ (if dryrun then "would be " else "") ++ "removed"+ putStrLn $ ghcinst ++ " compiler " ++ (if dryrun then "would be " else "") ++ "removed"
src/Snapshots.hs view
@@ -169,7 +169,8 @@ if allrecurse then return True else doesDirectoryExist ".stack-work" if recurse then do- workdirs <- sort <$> cmdLines "find" ["-type", "d", "-name", ".stack-work"]+ -- ignore find errors (e.g. access rights)+ workdirs <- sort . lines <$> cmdIgnoreErr "find" [".", "-type", "d", "-name", ".stack-work", "-prune"] [] unless (null workdirs) $ do mapM_ putStrLn workdirs Remove.prompt dryrun "these dirs"
stack-clean-old.cabal view
@@ -1,5 +1,5 @@ name: stack-clean-old-version: 0.3+version: 0.3.1 synopsis: Clean away old stack build artefacts description: A tool for removing old .stack-work/install builds and@@ -9,7 +9,7 @@ license-file: LICENSE author: Jens Petersen <juhpetersen@gmail.com> maintainer: Jens Petersen <juhpetersen@gmail.com>-copyright: 2020 Jens Petersen <juhpetersen@gmail.com>+copyright: 2020-2021 Jens Petersen <juhpetersen@gmail.com> homepage: https://github.com/juhp/stack-clean-old bug-reports: https://github.com/juhp/stack-clean-old/issues build-type: Simple