diff options
author | Jeremy Lin <[email protected]> | 2021-02-03 12:20:44 -0800 |
---|---|---|
committer | Jeremy Lin <[email protected]> | 2021-02-03 12:20:44 -0800 |
commit | 678d313836aa1268848ae1144864a9d8b9dd5d0e (patch) | |
tree | 621de0ca442453a98d381581d5463fe92b0a6f02 /tools | |
parent | 4628e4519de043aae343b4d0a1e2f110bd40aa8a (diff) | |
download | vaultwarden-678d313836aa1268848ae1144864a9d8b9dd5d0e.tar.gz vaultwarden-678d313836aa1268848ae1144864a9d8b9dd5d0e.zip |
global_domains.py: allow syncing to a specific Git ref
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/global_domains.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/global_domains.py b/tools/global_domains.py index 8a3b5a8f..5692d798 100755 --- a/tools/global_domains.py +++ b/tools/global_domains.py @@ -10,16 +10,17 @@ import urllib.request 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 |