mirror of
https://github.com/renovatebot/renovate.git
synced 2025-05-12 23:51:55 +00:00

Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com> Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Co-authored-by: Michael Kriese <michael.kriese@visualon.de> Co-authored-by: Rhys Arkins <rhys@arkins.net>
20 lines
666 B
TypeScript
20 lines
666 B
TypeScript
import is from '@sindresorhus/is';
|
|
import { AbstractMigration } from '../base/abstract-migration';
|
|
|
|
export class FileMatchMigration extends AbstractMigration {
|
|
override readonly deprecated = true;
|
|
override readonly propertyName = 'fileMatch';
|
|
|
|
override run(value: unknown): void {
|
|
if (is.string(value) || is.array(value, is.string)) {
|
|
const fileMatch = is.array(value) ? value : [value];
|
|
|
|
let managerFilePatterns = this.get('managerFilePatterns') ?? [];
|
|
managerFilePatterns = managerFilePatterns.concat(
|
|
fileMatch.map((match) => `/${match}/`),
|
|
);
|
|
|
|
this.setHard('managerFilePatterns', managerFilePatterns);
|
|
}
|
|
}
|
|
}
|