2020-05-01 16:03:48 +00:00
|
|
|
import { RenovateConfig } from '../../config';
|
2020-01-12 07:50:11 +00:00
|
|
|
import {
|
|
|
|
REPOSITORY_DISABLED,
|
|
|
|
REPOSITORY_FORKED,
|
|
|
|
} from '../../constants/error-messages';
|
2017-11-05 04:45:49 +00:00
|
|
|
|
2020-01-10 10:35:49 +00:00
|
|
|
export function checkIfConfigured(config: RenovateConfig): void {
|
2017-11-05 04:45:49 +00:00
|
|
|
if (config.enabled === false) {
|
2020-01-12 07:50:11 +00:00
|
|
|
throw new Error(REPOSITORY_DISABLED);
|
2017-11-05 04:45:49 +00:00
|
|
|
}
|
2018-12-31 05:46:00 +00:00
|
|
|
if (config.isFork && !config.includeForks) {
|
2020-01-12 07:50:11 +00:00
|
|
|
throw new Error(REPOSITORY_FORKED);
|
2017-11-05 04:45:49 +00:00
|
|
|
}
|
|
|
|
}
|