Merge pull request #80 from colincross/optionalremove
Make removing abandoned files optional
This commit is contained in:
commit
5c11f817e1
2 changed files with 12 additions and 4 deletions
|
@ -161,10 +161,12 @@ func Main(ctx *blueprint.Context, config interface{}, extraNinjaFileDeps ...stri
|
|||
}
|
||||
}
|
||||
|
||||
srcDir := filepath.Dir(bootstrapConfig.topLevelBlueprintsFile)
|
||||
err = removeAbandonedFiles(ctx, bootstrapConfig, srcDir, manifestFile)
|
||||
if err != nil {
|
||||
fatalf("error removing abandoned files: %s", err)
|
||||
if c, ok := config.(ConfigRemoveAbandonedFiles); !ok || c.RemoveAbandonedFiles() {
|
||||
srcDir := filepath.Dir(bootstrapConfig.topLevelBlueprintsFile)
|
||||
err := removeAbandonedFiles(ctx, bootstrapConfig, srcDir, manifestFile)
|
||||
if err != nil {
|
||||
fatalf("error removing abandoned files: %s", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,12 @@ type ConfigInterface interface {
|
|||
GeneratingPrimaryBuilder() bool
|
||||
}
|
||||
|
||||
type ConfigRemoveAbandonedFiles interface {
|
||||
// RemoveAbandonedFiles should return true if files listed in the
|
||||
// .ninja_log but not the output build.ninja file should be deleted.
|
||||
RemoveAbandonedFiles() bool
|
||||
}
|
||||
|
||||
type Stage int
|
||||
|
||||
const (
|
||||
|
|
Loading…
Reference in a new issue