aboutsummaryrefslogtreecommitdiff
path: root/apply.go
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2019-08-13 13:08:23 -0400
committerBen Burwell <ben@benburwell.com>2019-08-13 13:08:23 -0400
commit2fde66440ea282532bb1a8e0380e32d331302e39 (patch)
tree8ba7cad6de673a60493f9b87db3a489ded66821b /apply.go
parentb8dd7dae42e783f2236f889d276e66bedb182837 (diff)
truncate files when writing
Diffstat (limited to 'apply.go')
-rw-r--r--apply.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/apply.go b/apply.go
index 7ea5bf9..eaa528a 100644
--- a/apply.go
+++ b/apply.go
@@ -42,7 +42,7 @@ func applyFile(name string) error {
if err = os.MkdirAll(filepath.Dir(d), 0700); err != nil {
return err
}
- out, err := os.OpenFile(d, os.O_CREATE|os.O_WRONLY, 0600)
+ out, err := os.OpenFile(d, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0600)
if err != nil {
return err
}