Preserve loc permissions

This commit is contained in:
Nate Coraor
2025-03-04 13:20:07 -05:00
committed by mvdbeek
parent a5cc985765
commit 0ee30084cb
+3 -1
View File
@@ -289,7 +289,9 @@ class DataTable:
Color.print("Changes to .loc file:", Color.CYAN, flush=True)
subprocess.call(["diff", "-u", self.loc_file_path, self.new_loc_file_path])
if commit:
os.rename(self.new_loc_file_path, self.loc_file_path)
dest_stat = os.stat(self.loc_file_path)
shutil.move(self.new_loc_file_path, self.loc_file_path)
os.chmod(self.loc_file_path, dest_stat.st_mode)
else:
os.unlink(self.new_loc_file_path)
else: