<NME> update-puppeteer-config.js
<BEF> const fs = require('fs');
const path = require('path');

function checkIfCoreVariation() {
  const packagePath = path.join(__dirname, '..', 'package.json');
  // eslint-disable-next-line import/no-dynamic-require,global-require
  const packageJson = require(packagePath);

  return (packageJson.name === 'israeli-bank-scrapers-core');
}

function getPuppeteerChromiumVersion() {
  const puppeteerLibrary = checkIfCoreVariation() ? 'puppeteer-core' : 'puppeteer';
  const puppeteerPath = path.dirname(require.resolve(puppeteerLibrary));
  const revisionFilePath = path.join(puppeteerPath, 'lib/cjs/puppeteer/revisions.js');
  // eslint-disable-next-line import/no-dynamic-require,global-require
  const revisionRaw = fs.readFileSync(revisionFilePath, 'utf-8');
  const [, revisionNumber] = revisionRaw.match(/chromium: ['"`](.+?)['"`][,]/);
  return revisionNumber;
}

(function updatePuppeteerConfiguration() {
  console.log('extract puppeteer chromium version from module \'puppeteer|pupetter-core\'');

  const chromiumRevision = getPuppeteerChromiumVersion();
  const configPath = path.join(__dirname, '../src/puppeteer-config.json');
  // eslint-disable-next-line global-require,import/no-dynamic-require
  const configJson = require(configPath);
  configJson.chromiumRevision = chromiumRevision;
  fs.writeFileSync(configPath, JSON.stringify(configJson, null, '  '));

  console.log(`update 'src/puppeteer-config.json' file with puppeteer chroumium revision '${chromiumRevision}'`);
}())
}());

<MSG> Merge remote-tracking branch 'origin/master' into use-puppeteer-core

<DFF> @@ -1,13 +1,6 @@
 const fs = require('fs');
 const path = require('path');
-
-function checkIfCoreVariation() {
-  const packagePath = path.join(__dirname, '..', 'package.json');
-  // eslint-disable-next-line import/no-dynamic-require,global-require
-  const packageJson = require(packagePath);
-
-  return (packageJson.name === 'israeli-bank-scrapers-core');
-}
+const checkIfCoreVariation = require('./core-utils');
 
 function getPuppeteerChromiumVersion() {
   const puppeteerLibrary = checkIfCoreVariation() ? 'puppeteer-core' : 'puppeteer';
@@ -30,4 +23,4 @@ function getPuppeteerChromiumVersion() {
   fs.writeFileSync(configPath, JSON.stringify(configJson, null, '  '));
 
   console.log(`update 'src/puppeteer-config.json' file with puppeteer chroumium revision '${chromiumRevision}'`);
-}())
+}());

Merge remote-tracking branch 'origin/master' into use-puppeteer-core