lib/init.js
function checkPackageJsonInGit () {
  return exec('git', ['status', '--porcelain', 'package.json'])
    .then(function ([stdout, stderr]) {
      debug('git status --porcelain package.json', 'stdout', stdout, 'stderr', stderr)
      if (stdout.indexOf('package.json') >= 0) {
        throw new Error('package.json has changes!\n' +
          'I would like to add scripts to your package.json, but ' +
          'there are changes that have not been commited yet.\n' +
          'I don\'t want to damage anything, so I\'m not doing anyhting right now. ' +
          'Please commit your package.json')
      }
    })
}
function checkPackageJsonInGit () {
  return exec('git', ['status', '--porcelain', 'package.json'])
    .then(function ([stdout, stderr]) {
      debug('git status --porcelain package.json', 'stdout', stdout, 'stderr', stderr)
      if (stdout.indexOf('package.json') >= 0) {
        throw new Error('package.json has changes!\n' +
          'I would like to add scripts to your package.json, but ' +
          'there are changes that have not been commited yet.\n' +
          'I don\'t want to damage anything, so I\'m not doing anyhting right now. ' +
          'Please commit your package.json')
      }
    })
}
function checkPackageJsonInGit ( ) { return exec ( 'git' , [ 'status' , '--porcelain' , 'package.json' ] ) . then ( function ( [ stdout , stderr ] ) { debug ( 'git status --porcelain package.json' , 'stdout' , stdout , 'stderr' , stderr ) if ( stdout . indexOf ( 'package.json' ) >= 0 ) { throw new Error ( 'package.json has changes!\n' + 'I would like to add scripts to your package.json, but ' + 'there are changes that have not been commited yet.\n' + 'I don\'t want to damage anything, so I\'m not doing anyhting right now. ' + 'Please commit your package.json' ) } } ) }
Ensure that package.json is checked in and unmodified
@return {Promise<boolean>} true, if everything is fine
Ensure that package . json is checked in and unmodified