Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial commit

  • Loading branch information...
commit d09411dde3b2e3bf7f52a9f5ab6cbec8aed16897 0 parents
@mscharley authored
Showing with 48 additions and 0 deletions.
  1. +7 −0 LICENSE
  2. +41 −0 dsass
7 LICENSE
@@ -0,0 +1,7 @@
+Copyright (C) 2012 Matthew Scharley
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41 dsass
@@ -0,0 +1,41 @@
+#!/usr/bin/env ruby
+
+#####
+## CONFIGURATION
+#####
+
+default_args = ['--no-cache', '-t', 'expanded', '--unix-newlines', '-l', '--debug-info']
+
+#####
+## SCRIPT
+#####
+
+last_pwd = Dir.pwd
+while not File.exists? File.join("modules", "system", "system.info")
+ if last_pwd == Dir.pwd
+ print "Can't find a Drupal installation in this directory.\n"
+ exit 1
+ end
+
+ last_pwd = Dir.pwd
+ Dir.chdir('..')
+end
+
+print "Executing SASS in " + Dir.pwd + "\n"
+
+themes = ["themes", *Dir.glob('sites/*/themes')].map {|p| Dir.glob(p + "/**/*.info")}.flatten.map{|info| File.dirname(info)}.uniq
+sass_themes = themes.find_all {|p| File.directory? p + "/sass" }
+
+print "Found " + themes.length.to_s + " themes, " + sass_themes.length.to_s + " of which use SASS.\n"
+
+if sass_themes.length == 0
+ print "No themes use SASS, so quitting while we're ahead.\n"
+ exit
+end
+
+args = sass_themes.map {|theme| ['--watch', File.join(theme, "sass") + ":" + File.join(theme, "css")]}.flatten
+args = ['sass', default_args, args].flatten
+
+print args.join(" ") + "\n";
+exec *args
+
Please sign in to comment.
Something went wrong with that request. Please try again.