Skip to content

Commit

Permalink
pkg/tool/file/append: create file if none exists.
Browse files Browse the repository at this point in the history
Closes #469
cuelang/cue#469

GitOrigin-RevId: 31a327c32d5b8f2cf5bfc83b55c6b78f27c25dcf
Change-Id: If04b565fa97bbb280c4ba515fc042645ade4ca9e
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/7103
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
  • Loading branch information
chai2010 authored and mpvl committed Sep 16, 2020
1 parent 089f461 commit 4f4b7a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/tool/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (c *cmdAppend) Run(ctx *task.Context) (res interface{}, err error) {
return nil, ctx.Err
}

f, err := os.OpenFile(filename, os.O_APPEND|os.O_WRONLY, os.FileMode(mode))
f, err := os.OpenFile(filename, os.O_CREATE|os.O_APPEND|os.O_WRONLY, os.FileMode(mode))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 4f4b7a3

Please sign in to comment.