Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
Fix use-before-assignment
Browse files Browse the repository at this point in the history
Summary: Fixing some more small issues w/ the release script that came in during refactoring.

Reviewed By: ttsugriy

fbshipit-source-id: e852237
  • Loading branch information
nataliejameson authored and facebook-github-bot committed Jul 10, 2018
1 parent 5bf0a0d commit ed7b341
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 1 addition & 2 deletions tools/release/platforms/homebrew.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ def push_tap(git_repository, tap_path, version):
git_url = "[email protected]:{}.git".format(git_repository)

with tempfile.TemporaryDirectory() as temp_dir:
temp_dir = temp_dir.name
logging.info("Cloning {} into {}".format(git_url, temp_dir))
run(["git", "clone", git_url, temp_dir])

Expand Down Expand Up @@ -282,7 +281,7 @@ def validate_tap(homebrew_dir, tap_repository, version):
)
if moved:
brew(homebrew_dir, ["uninstall", brew_target])
if output != "{}/buck: stable {}".format(tap_repository, version):
if "{}/buck: stable {}".format(tap_repository, version) not in output:
raise ReleaseException(
"Expected version {} to be installed, but got this from `brew info {}`: {}".format(
version, tap_repository, output
Expand Down
9 changes: 6 additions & 3 deletions tools/release/publish_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ def publish(
chocolatey_token,
deb_file,
homebrew_file,
homebrew_dir,
chocolatey_file,
):
if args.upload_assets:
Expand All @@ -321,9 +322,9 @@ def publish(
publish_chocolatey(chocolatey_file, chocolatey_token)
if homebrew_file:
add_assets(release, github_token, homebrew_file)
validate_tap(args.tap_repository, args.version)
validate_tap(homebrew_dir, args.tap_repository, args.version)
if args.homebrew_push_tap:
publish_tap_changes(args.version, args.tap_repository)
publish_tap_changes(homebrew_dir, args.tap_repository, args.version)
else:
log_about_manual_tap_push(args.tap_repository)

Expand All @@ -346,6 +347,7 @@ def main():

temp_dir = None
temp_homebrew_dir = None
homebrew_file = None

try:
validate_environment(args)
Expand Down Expand Up @@ -377,6 +379,7 @@ def main():
chocolatey_token,
deb_file,
homebrew_file,
homebrew_dir,
chocolatey_file,
)

Expand All @@ -395,7 +398,7 @@ def remove(path):
remove(temp_dir)
if temp_homebrew_dir:
# If the person didn't want to publish, we need to keep this around
if not homebrew_file or not args.homebrew_push_tap:
if not homebrew_file or args.homebrew_push_tap:
remove(temp_homebrew_dir)


Expand Down

0 comments on commit ed7b341

Please sign in to comment.