fix(system): write all files atomically

This commit is contained in:
Jonathan Boulle
2014-06-05 12:48:32 -07:00
parent 56f455f890
commit 0ddc08d55a
8 changed files with 75 additions and 48 deletions

View File

@@ -78,12 +78,12 @@ func PlaceUnit(u *Unit, dst string) error {
}
file := File{
Path: dst,
Path: filepath.Base(dst),
Content: u.Content,
RawFilePermissions: "0644",
}
err := WriteFile(&file)
_, err := WriteFile(&file, dir)
if err != nil {
return err
}