Commit e68405e3 authored by Cédric Anne's avatar Cédric Anne Committed by Johan Cwiklinski

Compile all CSS during release build

parent 1ef893c4
......@@ -169,6 +169,10 @@ jobs:
name: ESLint
command: |
node_modules/.bin/eslint ./js && node_modules/.bin/eslint --env=node --parser-options=ecmaVersion:6 --rule 'indent: ["error", 4]' ./webpack.config.js && echo "ESLint found no errors"
- run:
name: Check CSS compilation
command: |
bin/console build:compile_scss
# PHP 7.0 test suite.
php_7_0_test_suite:
......
......@@ -82,7 +82,22 @@ class CompileScssCommand extends Command {
$files = $input->getOption('file');
if (empty($files)) {
$files[] = 'css/styles'; // Compile main styles if no file option is set.
$root_path = realpath(GLPI_ROOT);
$css_dir_iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($root_path . '/css'),
RecursiveIteratorIterator::SELF_FIRST
);
/** @var SplFileInfo $file */
foreach ($css_dir_iterator as $file) {
if (!$file->isReadable() || !$file->isFile() || $file->getExtension() !== 'scss') {
continue;
}
$files[] = str_replace($root_path . '/', '', dirname($file->getRealPath()))
. '/'
. preg_replace('/^_?(.*)\.scss$/', '$1', $file->getBasename());
}
}
foreach ($files as $file) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment