From abc56d4fc75e2f9be9304916dc271c9e4a7e8198 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Wed, 1 Mar 2017 17:38:41 -0800 Subject: [PATCH] Fix `dist` if $DIST_DIR/logs doesn't exist Bug: 35886901 Test: rm -rf out; m -j dist Change-Id: I1008d9eef884d60766e35a543e72df5df01d61de --- cmd/soong_ui/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/soong_ui/main.go b/cmd/soong_ui/main.go index 06a601e24..26887ae6c 100644 --- a/cmd/soong_ui/main.go +++ b/cmd/soong_ui/main.go @@ -72,9 +72,10 @@ func main() { build.SetupOutDir(buildCtx, config) if config.Dist() { - os.MkdirAll(config.DistDir(), 0777) - log.SetOutput(filepath.Join(config.DistDir(), "logs", "soong.log")) - trace.SetOutput(filepath.Join(config.DistDir(), "logs", "build.trace")) + logsDir := filepath.Join(config.DistDir(), "logs") + os.MkdirAll(logsDir, 0777) + log.SetOutput(filepath.Join(logsDir, "soong.log")) + trace.SetOutput(filepath.Join(logsDir, "build.trace")) } else { log.SetOutput(filepath.Join(config.OutDir(), "soong.log")) trace.SetOutput(filepath.Join(config.OutDir(), "build.trace"))