Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
Copy CSS files from each project's build directory into Helium's publ…
Browse files Browse the repository at this point in the history
…ic directory.
  • Loading branch information
jcoglan committed Jul 3, 2011
1 parent 40498f5 commit 073032e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/helium/deployer.rb
Expand Up @@ -129,20 +129,22 @@ def run_builds!(options = nil)
next unless File.directory?(path) and File.file?(join(path, JAKE_FILE))

project, commit = *path.split(SEP)[-2..-1]
heads = YAML.load(File.read(join(path, '..', HEAD_LIST)))
branches = heads.select { |head, id| id == commit }.map { |pair| pair.first }
heads = YAML.load(File.read(join(path, '..', HEAD_LIST)))
branches = heads.select { |head, id| id == commit }.map { |pair| pair.first }
build = nil

Jake.clear_hooks!

# Event listener to capture file information from Jake
hook = lambda do |build, package, build_type, file|
hook = lambda do |_, package, build_type, file|
build = _
if build_type == :min
@js_loader = file if File.basename(file) == LOADER_FILE and
project == JS_CLASS and
branches.include?(@jsclass_version)

file = file.sub(path, '')
manifest << join(project, commit, file)
manifest << File.join(project, commit, file)

branches.each do |branch|
@tree[[project, branch]] = commit
Expand All @@ -155,8 +157,8 @@ def run_builds!(options = nil)

log :jake_build, "Building branch '#{ branches * "', '" }' of '#{ project }' from #{ join(path, JAKE_FILE) }"

begin; Jake.build!(path)
rescue; end
Jake.build!(path) rescue nil
manifest += Dir[join(build.build_directory, '**', '*.css')].map { |p| p.gsub(static_dir, '') }
end

generate_manifest!
Expand Down Expand Up @@ -238,7 +240,7 @@ def method_missing(*args, &block)

def `(command)
puts command
system(command)
super
end

end
Expand Down

0 comments on commit 073032e

Please sign in to comment.