File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ html-nohighlight:
15
15
sparse :
16
16
perl6 htmlify.p6 --no-highlight --sparse=10
17
17
18
+ sass :
19
+ ./util/compile-sass.sh
20
+
18
21
webdev-build :
19
22
perl6 htmlify.p6 --no-highlight --sparse=200
20
23
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ #
3
+ # This script compiles site's SASS into CSS
4
+ # It requires either the presence of `sass` command (which will be tried first)
5
+ # or the CSS::Sass Perl 5 module: https://metacpan.org/pod/CSS::Sass
6
+ #
7
+
8
+ if command -v sass > /dev/null 2>&1 ; then
9
+ sass -t compressed assets/sass/style.scss:html/css/style.css &&
10
+ echo " Successfully compiled SASS using 'sass' command" ||
11
+ { echo " Failed to compile SASS with 'sass' command" ; exit 1; }
12
+ elif perl -MCSS::Sass -e ' ' > /dev/null 2>&1 ; then
13
+ perl -MData::Dumper -MCSS::Sass -wlE '
14
+ my ($css, $err, $stats) = CSS::Sass::sass_compile_file(
15
+ "assets/sass/style.scss",
16
+ output_style => SASS_STYLE_COMPRESSED
17
+ );
18
+ if (defined $err) {
19
+ print Dumper $stats;
20
+ say "Failed to compile sass (see diagnostics above)";
21
+ exit 1
22
+ };
23
+ my $f = "html/css/style.css";
24
+ open my $fh, ">", $f or
25
+ die "Failed to open $f to write CSS into: $!";
26
+ print $fh $css;
27
+ ' && echo " Successfully compiled SASS using CSS::Sass module" ||
28
+ { echo " Failed to compile SASS with CSS::Sass module" ; exit 1; }
29
+ else
30
+ echo " Need either 'sass' command or CSS::Sass Perl 5 module"
31
+ exit 1;
32
+ fi
You can’t perform that action at this time.
0 commit comments