Automation of CSS compilation, fixed .gitignore build issue

The grabbing of dependencies and compilation of SCSS can now simply be
done with a:

poetry run task compile-css

before a:

poetry build

When building from source. The issue where the .gitignore had to be
removed before building has been fixed, too.
This commit is contained in:
2020-07-06 15:04:28 +01:00
parent a62eab9565
commit 781306f1ef
10 changed files with 619 additions and 2103 deletions

17
scss/get_node_deps.py Normal file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env python3
import subprocess
from pathlib import Path
def runcmd(cmd):
proc = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
return proc.communicate()
print('Installing npm packages')
root_path = Path(__file__).parents[1]
runcmd(f'npm install --prefix {root_path}')
if (root_path / 'node_modules' / 'cleancss').exists():
print(f'Installed successfully in {str((root_path / "node_modules").resolve())}.')