2016-03-29 19:24:24 +02:00
|
|
|
// Fails if any .rej files are found
|
|
|
|
// .rej files are an artifact from a failed git-apply or a jasper backport
|
|
|
|
|
|
|
|
// This check is intentionally performed on the files in the repo rather than
|
|
|
|
// on the files that are to be committed.
|
|
|
|
|
|
|
|
export default grunt => {
|
|
|
|
grunt.registerTask('rejectRejFiles', 'Reject any git-apply .rej files', () => {
|
2018-02-13 21:56:25 +01:00
|
|
|
const files = grunt.file.expand([
|
|
|
|
'**/*.rej',
|
2018-03-22 01:48:49 +01:00
|
|
|
'!.es/**/*.rej',
|
2018-02-13 21:56:25 +01:00
|
|
|
'!plugins/**/*.rej',
|
|
|
|
'!optimize/**/*.rej',
|
|
|
|
'!**/node_modules/**/*.rej',
|
|
|
|
]);
|
2016-03-29 19:24:24 +02:00
|
|
|
|
|
|
|
if (files.length > 0) {
|
|
|
|
const err = `.rej files are not allowed:\n${files.join('\n')}`;
|
|
|
|
grunt.log.error(err);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|