aboutsummaryrefslogtreecommitdiffstats
path: root/bin/make_css_watch
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2014-11-05 15:07:54 +0000
committerMatthew Somerville <matthew@mysociety.org>2014-11-05 15:33:27 +0000
commit92fc64655c5b51ddec3286befd87d9693ca718c2 (patch)
tree2904171f3c8940659305f8e627e36ef3558c9d12 /bin/make_css_watch
parentcdf0d0f5129bd03a2f7990bee6c176cb77fabd3d (diff)
Update to use bundler and work on Ubuntu Trusty.
Switching to bundler saves confusion about gem paths when running sass/compass to compile the CSS. Trusty can use precisely the same packages as precise, with a few tweaks to generalise the contents.
Diffstat (limited to 'bin/make_css_watch')
-rwxr-xr-xbin/make_css_watch14
1 files changed, 12 insertions, 2 deletions
diff --git a/bin/make_css_watch b/bin/make_css_watch
index d46ee8997..63a27a35e 100755
--- a/bin/make_css_watch
+++ b/bin/make_css_watch
@@ -2,8 +2,10 @@
use strict;
use warnings;
use feature 'say';
+use Cwd qw(abs_path);
use File::ChangeNotify;
use File::Find::Rule;
+use FindBin;
use Path::Tiny;
my @exts = qw/
@@ -24,6 +26,14 @@ my $watcher = File::ChangeNotify->instantiate_watcher(
filter => $filter,
);
+my $script_compass = 'compass';
+my $script_sass = 'sass';
+my $gem_bin = abs_path("$FindBin::Bin/../../gem-bin");
+if (-f "$gem_bin/compass") {
+ $script_compass = "$gem_bin/compass";
+ $script_sass = "$gem_bin/sass";
+}
+
sub title {
my $what = shift;
# TODO, check if xtitle is installed and if so, run following command:
@@ -61,13 +71,13 @@ while ( my @events = $watcher->wait_for_events() ) {
}
for my $dir (@update_dirs) {
if (-e "$dir/config.rb") {
- system compass =>
+ system $script_compass,
'compile',
'--output-style' => 'compressed',
$dir;
}
else {
- system sass =>
+ system $script_sass,
'--scss',
'--update',
'--style' => 'compressed',