Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 34 lines (25 sloc) 0.704 kb
f3b284b @patcoll initial commit
authored
1 include FileUtils
2
3 BASE_FOLDER = File.expand_path(File.dirname(__FILE__))
4 BUILD = File.join(BASE_FOLDER, "build")
5 PUBLIC = File.join(BASE_FOLDER, "public")
6 TEMPLATES = File.join(BASE_FOLDER, "templates")
7
8 task :build do
9 cd BASE_FOLDER
10 rm_rf BUILD
11 mkdir_p BUILD
12
13 # copy assets
14 cd PUBLIC
15 cp_r "static", BUILD
ad32d04 @patcoll remove extra gitignore in build
authored
16 rm_f "#{BUILD}/static/.gitignore"
f3b284b @patcoll initial commit
authored
17
18 # get list of templates to process
19 cd TEMPLATES
20 templates = Dir["**/*"].delete_if { |p| not p =~ /\.html$/ }
21
22 cd BUILD
23 mkdirs = templates.map { |t| File.dirname(t) }.uniq
24 mkdir_p(mkdirs)
25
26 cd BASE_FOLDER
27 templates.each do |path|
28 sh "php #{PUBLIC}/index.php #{path} > #{BUILD}/#{path}"
29 end
30 end
31
32 task :default => :build
33
Something went wrong with that request. Please try again.