-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·34 lines (26 loc) · 1.32 KB
/
build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! /usr/bin/env php
<?php
# This is the build script for mono/color.
# Yes I could have used bash but I'm more comfortable with PHP scripting
# Plus I can use the CSS minifiers available instead of downloading an executable
# It's relatively easier for contributers as you're not forced to use a new editor like VS Code
# which once I didnt want to use. Most linux distros come with php pre-installed too.
require './vendor/autoload.php';
// the framework version. used for release archives
$version = "1.2";
use tubalmartin\CssMin\Minifier as CSSmin;
$compressor = new CSSmin;
$files = [ "mono", "dark", "light", "color" ];
// minify every css file mentioned above and save it with .min.css suffix
echo "Minifying CSS ...\n";
foreach ($files as $file) {
file_put_contents("$file.min.css", $compressor->run(file_get_contents("$file.css")));
}
# combine mono and color into a single css file for better gzipping
echo "Making mono-color.min.css ...\n";
file_put_contents("mono-color.min.css", file_get_contents("mono.min.css").file_get_contents("color.min.css"));
# create the release zip files
echo "Creating release archives ...\n";
`zip mono-only-$version.zip mono.min.css light.min.css dark.min.css template-mono-only.html`;
`zip mono-color-$version.zip mono.min.css light.min.css dark.min.css color.min.css template.html`;
echo "Done.\n";