Files
VirtualChemistry.Test/nuget_update.py
2024-07-10 15:55:31 +01:00

20 lines
658 B
Python

import requests
r = requests.get('http://127.0.0.1:3000/api/packages/hzhang/nuget/query')
res = r.text
d = eval(res)
skVersion = ""
vcVersion = ""
for x in d['data']:
if x['id'] == 'VirtualChemistry':
vcVersion = x['version']
if x['id'] == 'Skeleton':
skVersion = x['version']
w = open('VirtualChemistry.Test.csproj', 'r').read()
s = w.split('<ItemGroup>')
s[1] = '\n<PackageReference Include="VirtualChemistry" Version="'+vcVersion+'"/>\n' + s[1]
s[1] = '\n<PackageReference Include="Skeleton" Version="'+skVersion+'"/>\n' + s[1]
w = '<ItemGroup>'.join(s)
print(w)
with open('VirtualChemistry.Test.csproj', 'w') as f:
f.write(w)