Added update_configs task to update configurations for a theme

This commit is contained in:
Brandon Mathis 2013-04-03 19:58:27 -05:00
parent 1a4b0f24f3
commit f4d68f82d3
1 changed files with 10 additions and 1 deletions

View File

@ -45,6 +45,8 @@ task :install_configs, :theme do |t, args|
mkdir_p "_config"
if File.directory? ".themes/#{theme}/_config"
cp_r ".themes/#{theme}/_config/.", "_config/defaults", :remove_destination=>true
end
unless File.exist?('_config/site.yml')
user_config_site = <<-EOF
---
# --------------------------- #
@ -53,7 +55,8 @@ task :install_configs, :theme do |t, args|
EOF
File.open('_config/site.yml', 'w') { |f| f.write user_config_site }
end
unless File.exist?('_config/deploy.yml')
user_config_deploy = <<-EOF
---
# -------------------------- #
@ -268,10 +271,16 @@ desc "Update theme source and style"
task :update, :theme do |t, args|
theme = args.theme || 'classic'
Rake::Task[:update_source].invoke(theme)
Rake::Task[:update_configs].invoke(theme)
Rake::Task[:update_stylesheets].invoke(theme)
Rake::Task[:update_javascripts].invoke(theme)
end
task :update_configs, :theme do |t, args|
theme = args.theme || 'classic'
Rake::Task["install_configs"].invoke(theme)
end
desc "Move stylesheets to stylesheets.old, install stylesheets theme updates, replace stylesheets/custom with stylesheets.old/custom"
task :update_stylesheets, :theme do |t, args|
theme = args.theme || 'classic'