Use .tmp before the file extension (#529)

When creating temporary files use the pattern `.tmp.ext` instead of
`.ext.tmp` to be consistent with Factorio which creates `.tmp.zip` files
during saving.

If patching fails this will leave a `.tmp.zip` file in the instance saves
directory which is ignored by the default save selector.

Resolves #486.
This commit is contained in:
Hornwitser authored and GitHub committed 2023-11-30 01:21:06 +01:00
1 parent faadf873fb
commit d5bcd34cdb
6 files changed
+28 -12

No files matched your search

+2 -2
View File
@@ -15,11 +15,11 @@ describe("host/patch", function() {
const mappings = [
["locale/en/foo.cfg", "locale/en/test-foo.cfg"],
["locale/en/foo.txt", "locale/en/test-foo.txt"],
["locale/en/foo.txt.tmp", "locale/en/test-foo.txt.tmp"],
["locale/en/foo.tmp.txt", "locale/en/test-foo.tmp.txt"],
["locale/en/foo", "locale/en/test-foo"],
["locale/en.cfg", "locale/en/test.cfg"],
["locale/en.txt", "locale/en/test.txt"],
["locale/en.txt.tmp", "locale/en/test.txt.tmp"],
["locale/en.tmp.txt", "locale/en/test.tmp.txt"],
["locale/en", "locale/en/test"],
["locale/en/bar/foo.cfg", "locale/en/test-bar/foo.cfg"],
];