From d208b97c18f9496d856ffd916ddfb93fc38af032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 22 Oct 2020 19:56:52 +0200 Subject: [PATCH] build: remove generated css files on make clean (#47476) --- Makefile | 2 ++ get_themes.py | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/Makefile b/Makefile index b7bed400..d050f7e4 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,8 @@ clean: rm -rf sdist rm -f src/tmp-*.svg rm -f static/*/_data_uris.scss + -rm $$(python3 get_themes.py --include-map-files) + -rm static/portal-agent/css/agent-portal.css static/portal-agent/css/agent-portal.css.map static/includes/gadjo-extra.css static/includes/gadjo-extra.css.map DIST_FILES = \ Makefile \ diff --git a/get_themes.py b/get_themes.py index 3f233968..bec01bea 100644 --- a/get_themes.py +++ b/get_themes.py @@ -1,11 +1,21 @@ #! /usr/bin/env python3 +import argparse import os +parser = argparse.ArgumentParser(description='Display list of generated CSS files') +parser.add_argument('--include-map-files', dest='map_files', action='store_true', help='include .map files') + +args = parser.parse_args() + for dirname in sorted(os.listdir('static')): config = os.path.join('static', dirname, 'config.json') if not os.path.exists(config): continue print('static/%s/style.css' % dirname) + if args.map_files: + print('static/%s/style.css.map' % dirname) if os.path.exists(os.path.join('static', dirname, 'backoffice.scss')): print('static/%s/backoffice.css' % dirname) + if args.map_files: + print('static/%s/backoffice.css.map' % dirname)