]> gitweb.fluxo.info Git - leap/leap_cli.git/commitdiff
added @platform_branch to Leapfile
authorelijah <elijah@riseup.net>
Wed, 13 Mar 2013 09:28:49 +0000 (02:28 -0700)
committerelijah <elijah@riseup.net>
Wed, 13 Mar 2013 09:28:49 +0000 (02:28 -0700)
lib/leap_cli/leapfile.rb

index 06db3b48348dcdca48864aa47ed622c79b00c873..83000901fedec3dc8067a4959e9f6b89320aa6ac 100644 (file)
@@ -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