From a39a86c6badad1d05cdcb9a88e8dba36c1a1ac2f Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@keylocation.sg> Date: Fri, 21 Jul 2017 10:58:11 +0200 Subject: [PATCH] fix(yarn): Filter out pure-lockfile option from yarnrc A repository with .yarnrc specifying pure-lockfile was preventing our yarn from saving a lockfile too! Now filter it out before writing the yarnrc to our tmp directory. Closes #507 --- lib/workers/branch/yarn.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/workers/branch/yarn.js b/lib/workers/branch/yarn.js index 3b9b4efcf1..4c50fa5322 100644 --- a/lib/workers/branch/yarn.js +++ b/lib/workers/branch/yarn.js @@ -27,7 +27,11 @@ async function generateLockFile( fs.writeFileSync(path.join(tmpDir.name, '.npmrc'), npmrcContent); } if (yarnrcContent) { - fs.writeFileSync(path.join(tmpDir.name, '.yarnrc'), yarnrcContent); + const filteredYarnrc = yarnrcContent.replace( + '--install.pure-lockfile true', + '' + ); + fs.writeFileSync(path.join(tmpDir.name, '.yarnrc'), filteredYarnrc); } logger.debug('Spawning yarn install'); // Use an embedded yarn -- GitLab