From bd36c5d3e727c7ffd073d467760908ed4882d162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julia=20Kr=C3=BCger?= Date: Fri, 11 May 2018 12:15:16 +0200 Subject: [PATCH] fix(create-version-branch): handle repos that have no files object --- jobs/create-version-branch.js | 4 ++-- test/jobs/create-version-branch.js | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/jobs/create-version-branch.js b/jobs/create-version-branch.js index d19eee4a..e01526d1 100644 --- a/jobs/create-version-branch.js +++ b/jobs/create-version-branch.js @@ -69,8 +69,8 @@ module.exports = async function ( return x } - const hasModuleLockFile = isTrue(repository.files['npm-shrinkwrap.json']) - const hasProjectLockFile = isTrue(repository.files['package-lock.json']) || isTrue(repository.files['yarn.lock']) + const hasModuleLockFile = repository.files && isTrue(repository.files['npm-shrinkwrap.json']) + const hasProjectLockFile = repository.files && (isTrue(repository.files['package-lock.json']) || isTrue(repository.files['yarn.lock'])) const usesGreenkeeperLockfile = _.some(_.pick(repository.packages['package.json'].devDependencies, 'greenkeeper-lockfile')) // Bail if it’s in range and the repo uses shrinkwrap if (satisfies && hasModuleLockFile) { diff --git a/test/jobs/create-version-branch.js b/test/jobs/create-version-branch.js index 321e1a45..4963053e 100644 --- a/test/jobs/create-version-branch.js +++ b/test/jobs/create-version-branch.js @@ -55,12 +55,6 @@ describe('create version brach', () => { _id: '1', accountId: '123', fullName: 'finnp/test', - files: { - 'package.json': ['package.json'], - 'package-lock.json': [], - 'npm-shrinkwrap.json': [], - 'yarn.lock': [] - }, packages: { 'package.json': { greenkeeper: {