-
Notifications
You must be signed in to change notification settings - Fork 5
/
reflector.py
executable file
·40 lines (32 loc) · 1.11 KB
/
reflector.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python
from __future__ import print_function
from reflector import Mirror, Config
import argparse
def main():
parser = argparse.ArgumentParser(description='Synchronize an NuGet mirror from a target repository.')
parser.add_argument('-d', '--delta', action='store_true',
help='Sync the latest packages from the feed url.')
parser.add_argument('-f', '--full', action='store_true',
help='Reconcile the entire local mirror against the remote repo.')
args = parser.parse_args()
config = Config()
mirror = Mirror(
config.remote_url,
config.update_feed,
config.remote_json_api,
config.local_url,
config.local_json_api,
config.package_storage_path,
config.local_api_key,
config.dotnet_path,
config.hash_verify_downloads,
config.hash_verify_uploaded
)
if args.delta:
print('Starting a delta sync')
mirror.delta_sync()
if args.full:
print('Starting a full sync')
mirror.sync_packages()
if __name__ == "__main__":
main()