digital-vcd-render/scripts/vscode-package.py

14 lines
362 B
Python

import os
os.system('npm run build')
for file in os.listdir('dist'):
if file.endswith('.vcd') or file.endswith('.view'):
os.remove('dist/' + file)
with open('./dist/index.html', 'r', encoding='utf-8') as fp:
html = fp.read()
html = html.replace("''", "'<root>'")
with open('./dist/index.html', 'w', encoding='utf-8') as fp:
fp.write(html)