diff options
| author | Markus Heiser <markus.heiser@darmarIT.de> | 2022-01-14 13:59:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-14 13:59:39 +0100 |
| commit | e76437d0e0280776b7c1f4183fb3f1c407dfe3ff (patch) | |
| tree | c2627e760abf8411cba174bf0c778fd635f8681e | |
| parent | a340a9af3457fa969c029ea32e740490ed056ef5 (diff) | |
| parent | 580815a9a566acc3c6c3c1839fccc0eda229ddc6 (diff) | |
Merge pull request #756 from return42/fix-grunt-less
[fix] stop less grunt runner on missing files
| -rw-r--r-- | searx/static/themes/simple/gruntfile.js | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js index 446c52335..abb2dc44d 100644 --- a/searx/static/themes/simple/gruntfile.js +++ b/searx/static/themes/simple/gruntfile.js @@ -4,6 +4,15 @@ module.exports = function (grunt) { 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({ _brand: '../../../../src/brand', @@ -116,10 +125,20 @@ module.exports = function (grunt) { sourceMapURL: (name) => { const s = name.split('/'); return s[s.length - 1] + '.map'; }, outputSourceFiles: true, }, - files: { - "css/searxng.min.css": "src/less/style.less", - "css/searxng-rtl.min.css": "src/less/style-rtl.less" - } + files: [ + { + 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: { |