Skip to content

Commit

Permalink
global_domains.py: allow syncing to a specific Git ref
Browse files Browse the repository at this point in the history
  • Loading branch information
jjlin committed Feb 3, 2021
1 parent 4628e45 commit 678d313
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/global_domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@

from collections import OrderedDict

if len(sys.argv) != 2:
print("usage: %s <OUTPUT-FILE>" % sys.argv[0])
if not (2 <= len(sys.argv) <= 3):
print("usage: %s <OUTPUT-FILE> [GIT-REF]" % sys.argv[0])
print()
print("This script generates a global equivalent domains JSON file from")
print("the upstream Bitwarden source repo.")
sys.exit(1)

OUTPUT_FILE = sys.argv[1]
GIT_REF = 'master' if len(sys.argv) == 2 else sys.argv[2]

BASE_URL = 'https://github.com/bitwarden/server/raw/master'
BASE_URL = 'https://github.com/bitwarden/server/raw/%s' % GIT_REF
ENUMS_URL = '%s/src/Core/Enums/GlobalEquivalentDomainsType.cs' % BASE_URL
DOMAIN_LISTS_URL = '%s/src/Core/Utilities/StaticStore.cs' % BASE_URL

Expand Down

0 comments on commit 678d313

Please sign in to comment.