diff options
author | elijah <elijah@riseup.net> | 2013-03-13 02:28:49 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2013-03-13 02:28:49 -0700 |
commit | c423efee0ee0ac8fa13216e657198214ff27bb26 (patch) | |
tree | 140097eac4e8c40e03722b592bdc0d4a5056036a /lib | |
parent | 4a90cc6c7be71f746ff93f75a195c3584997dd1c (diff) | |
download | leap_cli-c423efee0ee0ac8fa13216e657198214ff27bb26.tar.gz leap_cli-c423efee0ee0ac8fa13216e657198214ff27bb26.tar.bz2 |
added @platform_branch to Leapfile
Diffstat (limited to 'lib')
-rw-r--r-- | lib/leap_cli/leapfile.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/leap_cli/leapfile.rb b/lib/leap_cli/leapfile.rb index 06db3b4..8300090 100644 --- a/lib/leap_cli/leapfile.rb +++ b/lib/leap_cli/leapfile.rb @@ -34,8 +34,18 @@ module LeapCli @platform_directory_path = File.expand_path(@platform_directory_path || '../leap_platform', @provider_directory_path) if @allow_production_deploy.nil? # by default, only allow production deploys from 'master' or if not a git repo - @allow_production_deploy = !LeapCli::Util.is_git_directory?(@provider_directory_path) || - LeapCli::Util.current_git_branch(@provider_directory_path) == 'master' + @allow_production_deploy = !Util.is_git_directory?(@provider_directory_path) || + Util.current_git_branch(@provider_directory_path) == 'master' + end + if @platform_branch && Util.is_git_directory?(@platform_directory_path) + Util.assert!( + Util.current_git_branch(@platform_directory_path) == @platform_branch, + "@platform_branch is set to '%s', but current branch of %s is '%s'." % [ + @platform_branch, + @platform_directory_path, + Util.current_git_branch(@platform_directory_path) + ] + ) end return true end |