mirror of https://git.wownero.com/dsc/mxe.git
skeleton: don't truncate index.html on write error
Write new version to a temporary file and rename it to index.html.
This commit is contained in:
parent
f1581d20bf
commit
38a5c97d0b
|
@ -170,8 +170,10 @@ def update_index_html(name, description, website):
|
|||
packages_html += '\n'
|
||||
# build and write HTML
|
||||
index_html = prefix + sep1 + packages_html + sep2 + suffix
|
||||
with open('index.html', 'wt') as f:
|
||||
(_, tmp_index_html) = tempfile.mkstemp()
|
||||
with open(tmp_index_html, 'wt') as f:
|
||||
f.write(index_html)
|
||||
os.rename(tmp_index_html, 'index.html')
|
||||
|
||||
def make_skeleton(
|
||||
name,
|
||||
|
|
Loading…
Reference in New Issue