Skip to content

Commit

Permalink
prepare 0.4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
juhp committed Aug 22, 2023
1 parent 8738a6e commit f291740
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 7 deletions.
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Release history for stack-clean-old

## 0.4.7 (2023-08-22)
- add --tarballs for programs/ ghc tarballs too (#9)
- bug fix to match both ghc-*.* and ghc-variant-*.* (#14)
- rename --os-system to --platform and add more explanation (#15)
- parse ghc installation versions more carefully
- ignore hidden files in stack dirs

## 0.4.6 (2022-02-03)
- fix --recursive and --subdirs to work again
- show --recursive dir paths
Expand Down
71 changes: 66 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A small tool to clean away older Haskell [stack](https://docs.haskellstack.org)
snapshot builds and ghc versions to recover diskspace.

## Usage
`stack-clean-old [size|list|remove|keep-minor|purge-older|delete-work] [(-P|--project)|(-G|--global)] [(-s|--subdirs)|(-r|--recursive)] [-d|--delete] [GHCVER]`
`stack-clean-old [size|list|remove|keep-minor|purge-older|delete-work] [(-P|--project)|(-G|--global)|(-C|--compilers)|(-T|--tarballs)] [(-s|--subdirs)|(-r|--recursive)] [-d|--delete] [GHCVER]`

In a project directory it acts on `.stack-work/install/` by default,
otherwise on `~/.stack/{snapshots,programs}/`.
Expand Down Expand Up @@ -49,9 +49,9 @@ all matching `.stack-work` dirs from the current directory and below
respectively.

Note is you have different ghc variants/archs installed
you may need to use the `--platform` to choose which one to query/clean:
examples include 'x86_64-linux-tinfo6', 'x86_64-linux', 'aarch64-linux-nix',
'x86_64-osx', 'aarch64-osx', etc.
you may need to use the `--platform` option to choose which one to query/clean:
examples include `x86_64-linux-tinfo6`, `x86_64-linux`, `aarch64-linux-nix`,
`x86_64-osx`, `aarch64-osx`, etc.

### Example usage
List a project's builds:
Expand Down Expand Up @@ -99,15 +99,18 @@ NB: If you regularly build your project for several branches/tags against the sa
_all_ `.stack-work/` dirs within (or outside) a project directory to save
space (seems same as `stack clean --full` inside a project).

### Help output
## Help output
(Note you can also run this tool via `stack clean-old`.)

To get help you can run `stack-clean-old --help` or just:
```ShellSession
$ stack-clean-old --version
0.4.7
$ stack-clean-old
Stack clean up tool

Usage: stack-clean-old [--version] COMMAND

Cleans away old stack-work builds (and pending: stack snapshots) to recover
diskspace. Use the --delete option to perform actual removals.
https://github.com/juhp/stack-clean-old#readme
Expand All @@ -126,6 +129,64 @@ Available commands:
recursively)
```

### Command options
All the commands have similar options. e.g.:

Size and list command:
```
$ stack-clean-old list --help
Usage: stack-clean-old list [(-P|--project) | (-S|--snapshots) | (-G|--global) |
(-C|--compilers) | (-T|--tarballs)]
[(-s|--subdirs) | (-r|--recursive)] [GHCVER]
[-o|--platform SYSTEM]
List sizes per ghc version
Available options:
-P,--project Act on current project's .stack-work/ [default in
project dir]
-S,--snapshots Act on ~/.stack/snapshots/
-G,--global Act on both ~/.stack/{programs,snapshots}/ [default
outside project dir]
-C,--compilers Act on ~/.stack/programs/ installations
-T,--tarballs Act on ~/.stack/programs/ tarballs
-s,--subdirs List subdirectories
-r,--recursive List subdirectories
-o,--platform SYSTEM Specify which OS platform to work on (eg
'x86_64-linux-tinfo6', 'aarch64-linux-nix',
'x86_64-osx', 'aarch64-osx', etc)
-h,--help Show this help text
```

Removal commands additionally have `--delete`:
```shellsession
$ stack-clean-old remove --help
Usage: stack-clean-old remove [-d|--delete]
[(-P|--project) | (-S|--snapshots) |
(-G|--global) | (-C|--compilers) |
(-T|--tarballs)]
[(-s|--subdirs) | (-r|--recursive)] GHCVER
[-o|--platform SYSTEM]

Remove for a ghc version

Available options:
-d,--delete Do deletion [default is dryrun]
-P,--project Act on current project's .stack-work/ [default in
project dir]
-S,--snapshots Act on ~/.stack/snapshots/
-G,--global Act on both ~/.stack/{programs,snapshots}/ [default
outside project dir]
-C,--compilers Act on ~/.stack/programs/ installations
-T,--tarballs Act on ~/.stack/programs/ tarballs
-s,--subdirs List subdirectories
-r,--recursive List subdirectories
-o,--platform SYSTEM Specify which OS platform to work on (eg
'x86_64-linux-tinfo6', 'aarch64-linux-nix',
'x86_64-osx', 'aarch64-osx', etc)
-h,--help Show this help text
```

## Installation

Run `stack install` or `cabal install`
Expand Down
4 changes: 2 additions & 2 deletions stack-clean-old.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: stack-clean-old
version: 0.4.6
version: 0.4.7
synopsis: Clean away old stack build artifacts
description:
A tool for removing old .stack-work/install builds and
Expand All @@ -9,7 +9,7 @@ license: BSD3
license-file: LICENSE
author: Jens Petersen <juhpetersen@gmail.com>
maintainer: Jens Petersen <juhpetersen@gmail.com>
copyright: 2020-2022 Jens Petersen <juhpetersen@gmail.com>
copyright: 2020-2023 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
Expand Down

0 comments on commit f291740

Please sign in to comment.