cosmetic: readability am: ce85ecb176
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2444579 Change-Id: I4772e567093cace606edcdb6fe486dacbd92ed4b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
2833cebfa2
1 changed files with 2 additions and 5 deletions
|
@ -139,9 +139,8 @@ func RunBlueprint(args Args, stopBefore StopBefore, ctx *blueprint.Context, conf
|
||||||
if err := os.WriteFile(joinPath(ctx.SrcDir(), args.OutFile), []byte(nil), outFilePermissions); err != nil {
|
if err := os.WriteFile(joinPath(ctx.SrcDir(), args.OutFile), []byte(nil), outFilePermissions); err != nil {
|
||||||
fatalf("error writing empty Ninja file: %s", err)
|
fatalf("error writing empty Ninja file: %s", err)
|
||||||
}
|
}
|
||||||
}
|
out = io.Discard.(io.StringWriter)
|
||||||
|
} else {
|
||||||
if !args.EmptyNinjaFile {
|
|
||||||
f, err := os.OpenFile(joinPath(ctx.SrcDir(), args.OutFile), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, outFilePermissions)
|
f, err := os.OpenFile(joinPath(ctx.SrcDir(), args.OutFile), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, outFilePermissions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fatalf("error opening Ninja file: %s", err)
|
fatalf("error opening Ninja file: %s", err)
|
||||||
|
@ -149,8 +148,6 @@ func RunBlueprint(args Args, stopBefore StopBefore, ctx *blueprint.Context, conf
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
buf = bufio.NewWriterSize(f, 16*1024*1024)
|
buf = bufio.NewWriterSize(f, 16*1024*1024)
|
||||||
out = buf
|
out = buf
|
||||||
} else {
|
|
||||||
out = io.Discard.(io.StringWriter)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := ctx.WriteBuildFile(out); err != nil {
|
if err := ctx.WriteBuildFile(out); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue