INNER CODE UNIT · Python
collect
alper-han/CrossMacro · scripts/ci/nuget-cache.py:51
def collect(packages, feed):
"""Keep only the package versions actually used by this successful job."""
feed.mkdir(parents=True, exist_ok=True)
used = set()
for archive in packages.glob('*/*/*.nupkg'):
if archive.is_symlink():
continue
used.add(archive.name)
target = feed / archive.name
if not target.exists():
shutil.copyfile(archive, target)
for archive in feed.glob('*.nupkg'):
if archive.name not in used:
archive.unlink()
return len(used)
def append(path, values):