@@ -32,6 +32,8 @@ def __init__(self, app):
32
32
self .build_info = []
33
33
# App version
34
34
self .app_version = ''
35
+ # App readme
36
+ self .readme = ''
35
37
36
38
current_app = App (None )
37
39
@@ -131,6 +133,9 @@ def remove_app_from_config(apps):
131
133
matched_build_info .append (build_info )
132
134
if matched_build_info :
133
135
app ['build_info' ] = matched_build_info
136
+ if config_apps [app_dir ].get ('readme' ):
137
+ print (config_apps [app_dir ]['readme' ])
138
+ app ['readme' ] = config_apps [app_dir ]['readme' ]
134
139
new_apps .append (app )
135
140
136
141
return new_apps
@@ -208,6 +213,8 @@ def write_app(app):
208
213
toml_obj [support_app ] = {}
209
214
toml_obj [support_app ]['android_app_url' ] = ''
210
215
toml_obj [support_app ]['ios_app_url' ] = ''
216
+ if app .get ('readme' ):
217
+ toml_obj [support_app ]['readme.text' ] = app ['readme' ]
211
218
if not toml_obj [support_app ].get ('chipsets' ):
212
219
toml_obj [support_app ]['chipsets' ] = [f'{ build_info ["target" ]} -{ build_info ["sdkconfig" ]} ' ]
213
220
else :
@@ -225,14 +232,14 @@ def create_config_toml(apps):
225
232
226
233
# This is a workaround to remove the quotes around the image.<string> in the config.toml file as dot is not allowed in the key by default
227
234
with open ('binaries/config.toml' , 'r' ) as toml_file :
228
- fixed = replace_image_string (toml_file .read ())
235
+ fixed = replace_image_and_readme_string (toml_file .read ())
229
236
230
237
with open ('binaries/config.toml' , 'w' ) as toml_file :
231
238
toml_file .write (fixed )
232
239
233
- def replace_image_string (text ):
240
+ def replace_image_and_readme_string (text ):
234
241
# Define the regular expression pattern to find "image.<string>"
235
- pattern = r'"(image\.[\w-]+)"'
242
+ pattern = r'"(( image|readme) \.[\w-]+)"'
236
243
# Use re.sub() to replace the matched pattern with image.<string>
237
244
result = re .sub (pattern , r'\1' , text )
238
245
return result
0 commit comments