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:
Usta Shrestha 2023-02-23 19:14:04 +00:00 committed by Automerger Merge Worker
commit 2833cebfa2

View file

@ -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 {
fatalf("error writing empty Ninja file: %s", err)
}
}
if !args.EmptyNinjaFile {
out = io.Discard.(io.StringWriter)
} else {
f, err := os.OpenFile(joinPath(ctx.SrcDir(), args.OutFile), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, outFilePermissions)
if err != nil {
fatalf("error opening Ninja file: %s", err)
@ -149,8 +148,6 @@ func RunBlueprint(args Args, stopBefore StopBefore, ctx *blueprint.Context, conf
defer f.Close()
buf = bufio.NewWriterSize(f, 16*1024*1024)
out = buf
} else {
out = io.Discard.(io.StringWriter)
}
if err := ctx.WriteBuildFile(out); err != nil {