aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tasks
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2012-11-01 14:45:43 +1100
committerMatthew Landauer <matthew@openaustralia.org>2012-11-01 14:45:43 +1100
commit382ebe94f30ab2a276a08944a9bea1448ab05440 (patch)
tree63774e5a5c42c327d6c42f6c29dda7320ed8c977 /lib/tasks
parent458406e25f511fc0496c5f5c12dae8f5e3562910 (diff)
Add optional branch to install themes from. Falls back if it doesn't exist.
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/themes.rake12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/tasks/themes.rake b/lib/tasks/themes.rake
index f06cf6312..14aa15551 100644
--- a/lib/tasks/themes.rake
+++ b/lib/tasks/themes.rake
@@ -16,6 +16,10 @@ namespace :themes do
success
end
+ def checkout_remote_branch(branch)
+ system("git checkout origin/#{branch}")
+ end
+
def usage_tag(version)
"use-with-alaveteli-#{version}"
end
@@ -26,8 +30,12 @@ namespace :themes do
clone_command = "git clone #{uri} #{name}"
if system(clone_command)
Dir.chdir install_path do
- # try to checkout a tag exactly matching ALAVETELI VERSION
- tag_checked_out = checkout_tag(ALAVETELI_VERSION)
+ # First try to checkout a specific branch of the theme
+ tag_checked_out = checkout_remote_branch(Configuration::theme_branch) if Configuration::theme_branch
+ if !tag_checked_out
+ # try to checkout a tag exactly matching ALAVETELI VERSION
+ tag_checked_out = checkout_tag(ALAVETELI_VERSION)
+ end
if ! tag_checked_out
# if we're on a hotfix release (four sequence elements or more),
# look for a usage tag matching the minor release (three sequence elements)