mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
nixos/limine: atomically copy files
This commit is contained in:
parent
0d72d6d5e0
commit
2c7659b1ff
1 changed files with 2 additions and 1 deletions
|
@ -203,7 +203,8 @@ def copy_file(from_path: str, to_path: str):
|
||||||
if not os.path.exists(dirname):
|
if not os.path.exists(dirname):
|
||||||
os.makedirs(dirname)
|
os.makedirs(dirname)
|
||||||
|
|
||||||
shutil.copyfile(from_path, to_path)
|
shutil.copyfile(from_path, to_path + ".tmp")
|
||||||
|
os.rename(to_path + ".tmp", to_path)
|
||||||
|
|
||||||
def option_from_config(name: str, config_path: List[str], conversion: Callable[[str], str] | None = None) -> str:
|
def option_from_config(name: str, config_path: List[str], conversion: Callable[[str], str] | None = None) -> str:
|
||||||
if config(*config_path):
|
if config(*config_path):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue