File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ set VERSION=9.5.1
55@ REM set BRANCH=Release-%VERSION%
66@ REM git branch %BRANCH%
77@ REM git checkout %BRANCH%
8+
9+
10+ @ REM run python prepare-release-files.py
11+ python prepare-release-files.py
12+
813cd ..
914mkdir dist
1015set FOLDER = dist\kratos-%VERSION%
Original file line number Diff line number Diff line change 1+ # read the file kratos_default.spd, and parse it as xml
2+ # then extract the version number
3+
4+ import xml .etree .ElementTree as ET
5+ import sys
6+
7+ def get_version_number (file_name ):
8+ tree = ET .parse (file_name )
9+ root = tree .getroot ()
10+ version = root .find ('version' ).text
11+ return version
12+
13+ if __name__ == "__main__" :
14+
15+ file_name = "../kratos.gid/kratos_default.spd"
16+ version = get_version_number (file_name )
17+ print (version )
18+
19+ # Get all the applications whose tag is appLink
20+ tree = ET .parse (file_name )
21+ root = tree .getroot ()
22+ applications = root .findall ('.//appLink' )
23+ # create a list of applications, reading the field 'n'
24+
25+ app_list = []
26+ for app in applications :
27+ app_list .append (app .attrib ['n' ])
28+
29+ print (app_list )
30+ # if there is a folder in the folder apps whose name is not in the list, delete it
31+
32+ folder_name = "../kratos.gid/apps"
33+ import os
34+ for folder in os .listdir (folder_name ):
35+ if folder not in app_list :
36+ print ("Deleting folder: " , folder )
37+ import shutil
38+ shutil .rmtree (folder_name + "/" + folder )
39+
40+ # Ready
41+ print ("Ready to release version: " , version )
42+
43+
You can’t perform that action at this time.
0 commit comments