1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-19 19:00:10 +01:00

Merge pull request #756 from return42/fix-grunt-less

[fix] stop less grunt runner on missing files
This commit is contained in:
Markus Heiser 2022-01-14 13:59:39 +01:00 committed by GitHub
commit e76437d0e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,15 @@ module.exports = function (grunt) {
const eachAsync = require('each-async'); const eachAsync = require('each-async');
function file_exists (filepath) {
// filter function to exit grunt task with error if a (src) file not exists
if (!grunt.file.exists(filepath)) {
grunt.fail.fatal('Could not find: ' + filepath, 42);
} else {
return true;
}
}
grunt.initConfig({ grunt.initConfig({
_brand: '../../../../src/brand', _brand: '../../../../src/brand',
@ -116,10 +125,20 @@ module.exports = function (grunt) {
sourceMapURL: (name) => { const s = name.split('/'); return s[s.length - 1] + '.map'; }, sourceMapURL: (name) => { const s = name.split('/'); return s[s.length - 1] + '.map'; },
outputSourceFiles: true, outputSourceFiles: true,
}, },
files: { files: [
"css/searxng.min.css": "src/less/style.less", {
"css/searxng-rtl.min.css": "src/less/style-rtl.less" src: ['src/less/style.less'],
} dest: 'css/searxng.min.css',
nonull: true,
filter: file_exists,
},
{
src: ['src/less/style-rtl.less'],
dest: 'css/searxng-rtl.min.css',
nonull: true,
filter: file_exists,
},
],
}, },
}, },
image: { image: {