alecthomas / alecthomas/bit

Ensure outdated/removed/zombie outputs are deleted

Offen
#5 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
17
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Given a rule like:

```
build/%{1}: cmd/*
inputs: **/*.go
build: go build -o %{OUT} -o build/%{1}
```

If a `cmd` is removed or renamed between builds, the `build` directory will contain stale outputs. The Bit database could be used to track this . This should be relatively straightforward, in that we could populate a variable with a list of files that have been removed from the build since the last run.

eg.

```
build/%{1}: cmd/*
inputs: **/*.go
build:
for stale in %{STALE}; do [[ $stale == build/* ]] && rm $stale; done
go build -o %{OUT} -o build/%{1}
```

Shake has the concept of ["pruning"](http://neilmitchell.blogspot.com/2015/04/cleaning-stale-files-with-shake.html), which could be useful inspiration.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.