From 75e3dc9887a403d04feb4ad03a073e26ee18c5cc Mon Sep 17 00:00:00 2001 From: mdolinin Date: Fri, 7 Jan 2022 20:51:05 -0500 Subject: [PATCH] [Bugfix] Do not override content of gradle.properties if it is exist --- src/cache-base.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cache-base.ts b/src/cache-base.ts index acfa556..1479f37 100644 --- a/src/cache-base.ts +++ b/src/cache-base.ts @@ -230,7 +230,10 @@ export class GradleStateCache { private initializeGradleUserHome(gradleUserHome: string, initScriptsDir: string): void { const propertiesFile = path.resolve(gradleUserHome, 'gradle.properties') - fs.writeFileSync(propertiesFile, 'org.gradle.daemon=false') + const requiredProperties = 'org.gradle.daemon=false' + if (!fs.existsSync(propertiesFile) || !fs.readFileSync(propertiesFile).includes(requiredProperties)) { + fs.appendFileSync(propertiesFile, `\n${requiredProperties}`) + } const buildScanCapture = path.resolve(initScriptsDir, 'build-scan-capture.init.gradle') fs.writeFileSync(