Skip to content

Instantly share code, notes, and snippets.

@or-shachar
Last active February 15, 2021 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save or-shachar/23bc3a3ff9b912c0a3168a765575e07a to your computer and use it in GitHub Desktop.
Save or-shachar/23bc3a3ff9b912c0a3168a765575e07a to your computer and use it in GitHub Desktop.
Pseudocode for bazel wrapper that generates external repositories file
current_branch <- get_current_branch()
if (force_latest): # for specific CI cases
recreate_file(current_branch)
else:
git_aware_file_for_branch <- find_locked_file_for_branch(current_branch)
git_ignored_file <- find_git_ignored_file_for_branch(current_branch)
if (git_aware_file_for_branch):
symlink(current_2nd_party_file, git_aware_file)
else if (git_ignored_file):
symlink(current_2nd_party_file, git_ignored_file)
else:
recreate_file(current_branch) # calls the script
call $BAZEL_REAL $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment