From 1e5eb04d2c592635c8b9f2893df0a69ce02f1972 Mon Sep 17 00:00:00 2001 From: Jonathan Hooper Date: Mon, 4 Jun 2018 09:08:41 -0500 Subject: [PATCH 1/3] Fix check for hub installation in release script **Why**: `''` is truthy, and `0` is falsy. --- bin/release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/release b/bin/release index f186f313120..b9f0ade7baa 100755 --- a/bin/release +++ b/bin/release @@ -132,7 +132,7 @@ def deploy_to_prod end def open_pr_for_int - run "brew install hub" unless `brew list -1 | grep -Fqx hub` + run "brew install hub" unless `brew list -1 | grep -Fqx hub`.length run "hub pull-request -m \"Deploy #{RC_BRANCH} to int\" -b stages/int" end From 546a55428bb0afad5614c44d6a61fc477b14b9e6 Mon Sep 17 00:00:00 2001 From: Jonathan Hooper Date: Mon, 4 Jun 2018 09:26:01 -0500 Subject: [PATCH 2/3] add comparison --- bin/release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/release b/bin/release index b9f0ade7baa..10887450231 100755 --- a/bin/release +++ b/bin/release @@ -132,7 +132,7 @@ def deploy_to_prod end def open_pr_for_int - run "brew install hub" unless `brew list -1 | grep -Fqx hub`.length + run "brew install hub" unless `brew list -1 | grep -Fqx hub`.length > 0 run "hub pull-request -m \"Deploy #{RC_BRANCH} to int\" -b stages/int" end From 48486f9c281a2193c6711b0f1d30114c684e0f19 Mon Sep 17 00:00:00 2001 From: Jonathan Hooper Date: Mon, 4 Jun 2018 09:33:03 -0500 Subject: [PATCH 3/3] make it easier to understand --- bin/release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/release b/bin/release index 10887450231..ab0ebc620ed 100755 --- a/bin/release +++ b/bin/release @@ -132,7 +132,7 @@ def deploy_to_prod end def open_pr_for_int - run "brew install hub" unless `brew list -1 | grep -Fqx hub`.length > 0 + run "brew install hub" if `brew list -1 | grep -Fqx hub`.empty? run "hub pull-request -m \"Deploy #{RC_BRANCH} to int\" -b stages/int" end