Merge pull request #20371 from drodil/custom_preparer_cleanup
feat: allow prepared directory clean up for custom preparers
This commit is contained in:
@@ -60,6 +60,11 @@ export class DirectoryPreparer implements PreparerBase {
|
||||
this.scmIntegrations = ScmIntegrations.fromConfig(config);
|
||||
}
|
||||
|
||||
/** {@inheritDoc PreparerBase.shouldCleanPreparedDirectory} */
|
||||
shouldCleanPreparedDirectory() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** {@inheritDoc PreparerBase.prepare} */
|
||||
async prepare(
|
||||
entity: Entity,
|
||||
|
||||
@@ -78,6 +78,11 @@ export type PreparerBase = {
|
||||
* @throws `NotModifiedError` when the prepared directory has not been changed since the last build.
|
||||
*/
|
||||
prepare(entity: Entity, options?: PreparerOptions): Promise<PreparerResponse>;
|
||||
|
||||
/**
|
||||
* Indicates whether the prepared directory should be cleaned after generation.
|
||||
*/
|
||||
shouldCleanPreparedDirectory(): boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -47,6 +47,11 @@ export class UrlPreparer implements PreparerBase {
|
||||
this.reader = reader;
|
||||
}
|
||||
|
||||
/** {@inheritDoc PreparerBase.shouldCleanPreparedDirectory} */
|
||||
shouldCleanPreparedDirectory() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** {@inheritDoc PreparerBase.prepare} */
|
||||
async prepare(
|
||||
entity: Entity,
|
||||
|
||||
Reference in New Issue
Block a user