cosmetic: readability am: ce85ecb176 am: 2833cebfa2 am: a694aae313 am: c3d49aa6ae

Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2444579

Change-Id: I327e387650db401b6e16a4f1ee826798ad81ad0a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Usta Shrestha 2023-02-24 05:40:21 +00:00 committed by Automerger Merge Worker
commit a48d39b674

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 {