Skip to content

Commit

Permalink
fix(create-version-branch): handle repos that have no files object
Browse files Browse the repository at this point in the history
  • Loading branch information
Realtin committed May 11, 2018
1 parent 3d3299e commit bd36c5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 2 additions & 2 deletions jobs/create-version-branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 0 additions & 6 deletions test/jobs/create-version-branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit bd36c5d

Please sign in to comment.