File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import os
22import sys
33import glob
4+ import json
45from zipfile import ZipFile
56
67if len (sys .argv ) == 2 :
1213varName = 'Yoooi.ToySerialController.{}.var' .format (version )
1314zipPath = 'Custom\\ Scripts\\ Yoooi\\ ToySerialController\\ '
1415
16+ print ('Reading meta.json' )
17+ with open ('meta.json' ) as f :
18+ meta = json .load (f )
19+
1520print ('Creating "{}"' .format (cslistName ))
1621with open ('ADD_ME.cslist' , 'w+' , encoding = 'utf-8' ) as cslist :
1722 for file in sorted (glob .glob ('**/*.cs' , recursive = True )):
1823 if not file .startswith ('src' ) and not file .startswith ('lib' ):
1924 continue
2025
21- cslist .write ('{}\n ' .format (file ))
2226 print ('Adding "{}"' .format (file ))
27+ cslist .write ('{}\n ' .format (file ))
28+ meta ['contentList' ].append (os .path .join (zipPath , file ))
2329
2430print ('Creating "{}"' .format (varName ))
2531with open (cslistName , 'r' , encoding = 'utf-8' ) as cslist :
2632 with ZipFile (varName , 'w' ) as var :
27- var .write ('meta.json' )
33+ var .writestr ('meta.json' , json . dumps ( meta , indent = 3 ) )
2834 var .write ('LICENSE.md' )
2935 var .write (cslistName , os .path .join (zipPath , cslistName ))
3036 for file in [x .strip () for x in cslist ]:
You can’t perform that action at this time.
0 commit comments