chore: auto create lang nuspec files.

This commit is contained in:
NaBian committed 2023-09-28 14:56:51 +08:00
1 parent fc628774d7
commit 3b2fc5ee7e
3 files changed
+75

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
from pathlib import Path
def main():
with open('build.Lang.template.nuspec', 'r', encoding='utf-8') as template_file:
template_content = template_file.read()
resx_file_folder = Path('../src/Shared/HandyControl_Shared/Properties/Langs')
for lang in [path.stem.lstrip('Lang.') for path in resx_file_folder.glob('Lang.*.resx')]:
with open(f'build.Lang.{lang}.nuspec', 'w', encoding='utf-8') as nuspec_file:
nuspec_file.write(template_content.format(lang=lang))
if __name__ == '__main__':
main()