Skip to content

Commit 1ec75e5

Browse files
Copilotdorkmo
andcommitted
Restructure file write logic to avoid unnecessary writes
Co-authored-by: dorkmo <[email protected]>
1 parent 463bb3d commit 1ec75e5

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

.github/workflows/html-render.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -312,27 +312,25 @@ setTimeout(() => {{
312312
# Just render the page without API calls
313313
html_content = html_content.replace('loadData();', '// Sample data mode - loadData() disabled for static preview')
314314

315-
# Write the primary version
316-
output_file = f'{output_dir}/{file_name}.html'
317-
with open(output_file, 'w', encoding='utf-8') as out:
318-
out.write(html_content)
319-
320-
print(f'Extracted {file_name} HTML: {len(html_content)} bytes')
321-
322-
# For CLIENT_CONSOLE_HTML, also write the additional versions
315+
# For CLIENT_CONSOLE_HTML, write the special versions
323316
if const_name == 'CLIENT_CONSOLE_HTML':
324317
# Write the PIN setup version
325318
output_file_pin = f'{output_dir}/client-console-pin-setup.html'
326319
with open(output_file_pin, 'w', encoding='utf-8') as out:
327320
out.write(html_with_pin)
328321
print(f'Extracted client-console-pin-setup HTML: {len(html_with_pin)} bytes')
329322

330-
# Replace the primary version with the unlocked version
331-
# (The original html_content was written above, now replace with unlocked version)
332-
output_file_unlocked = f'{output_dir}/{file_name}.html'
333-
with open(output_file_unlocked, 'w', encoding='utf-8') as out:
323+
# Write the unlocked version as the primary file
324+
output_file = f'{output_dir}/{file_name}.html'
325+
with open(output_file, 'w', encoding='utf-8') as out:
334326
out.write(html_unlocked)
335327
print(f'Extracted client-console (unlocked) HTML: {len(html_unlocked)} bytes')
328+
else:
329+
# Write the primary version for all other pages
330+
output_file = f'{output_dir}/{file_name}.html'
331+
with open(output_file, 'w', encoding='utf-8') as out:
332+
out.write(html_content)
333+
print(f'Extracted {file_name} HTML: {len(html_content)} bytes')
336334
EOF
337335

338336
- name: Extract and render HTML for 112025 Viewer

0 commit comments

Comments
 (0)