Skip to content

Instantly share code, notes, and snippets.

@nomnel
Last active August 29, 2015 14:06
Show Gist options
  • Save nomnel/3d0476cd4970cb6d37ee to your computer and use it in GitHub Desktop.
Save nomnel/3d0476cd4970cb6d37ee to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'rails/all'
Bundler.require(*Rails.groups)
require 'sass'
require 'sass/exec'
target_files = ARGV.select {|x| x[-5..-1] == '.sass'}
exit 0 if target_files.blank?
alias :org_exit :exit
def exit(*args); end
target_files.each do |x|
converter = Sass::Exec::SassConvert.new(%w(-F sass -T scss) + [x, x.sub(/\.sass$/, '.scss')])
converter.parse!
end
scss_files = target_files.map {|x| x.sub(/\.sass$/, '.scss') }
require 'scss_lint'
require 'scss_lint/cli'
SCSSLint::CLI.new(scss_files).tap do |cli|
cli.parse_arguments
cli.run
end
File.unlink(*scss_files)
alias :exit :org_exit
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment