greenkeeper-lockfile
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -15,3 +15,4 @@ 'use strict' | ||
semaphoreci: () => env.SEMAPHORE === 'true', | ||
teamcity: () => env.TEAMCITY_VERSION !== undefined | ||
teamcity: () => env.TEAMCITY_VERSION !== undefined, | ||
appveyor: () => env.APPVEYOR === 'True' | ||
} |
@@ -44,3 +44,3 @@ 'use strict' | ||
module.exports.stageLockfile = function stageLockfile () { | ||
module.exports.stageLockfile = function stageLockfile (options) { | ||
// make sure that we have changes to add | ||
@@ -50,5 +50,6 @@ if (exec('git status --porcelain').toString() === '') return | ||
// stage the updated lockfile | ||
exec('git add npm-shrinkwrap.json 2>/dev/null || true') | ||
exec('git add package-lock.json 2>/dev/null || true') | ||
exec('git add yarn.lock 2>/dev/null || true') | ||
const ignoreOutput = (options !== undefined && options.ignoreOutput !== undefined) ? options.ignoreOutput : '2>/dev/null || true' | ||
exec(`git add npm-shrinkwrap.json ${ignoreOutput}`) | ||
exec(`git add package-lock.json ${ignoreOutput}`) | ||
exec(`git add yarn.lock ${ignoreOutput}`) | ||
} | ||
@@ -55,0 +56,0 @@ |
{ | ||
"name": "greenkeeper-lockfile", | ||
"description": "Your lockfile, up to date, all the time", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"author": "Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)", | ||
@@ -6,0 +6,0 @@ "bin": { |
@@ -172,2 +172,6 @@ # Greenkeeper Lockfile | ||
The following optional information may be needed: | ||
* **ignoreOutput** The method to ignore command output when staging the updated lockfile (e.g. `2>NUL || (exit 0)` on Windows) | ||
Have a look at our [Travis CI reference implementation](ci-services/travis.js). | ||
@@ -174,0 +178,0 @@ |
@@ -181,1 +181,10 @@ 'use strict' | ||
}) | ||
test('with truthy ignoreOutput', () => { | ||
prepare() | ||
exec.withArgs('npm --version').returns('3.0.0') | ||
updateLockfile(dependency, {ignoreOutput: '2>/dev/null || true'}) | ||
stageLockfile() | ||
commitLockfiles() | ||
expect(exec.args.map(args => args[0])).toMatchSnapshot() | ||
}) |
@@ -95,3 +95,5 @@ #!/usr/bin/env node | ||
stageLockfile() | ||
stageLockfile({ | ||
ignoreOutput: info.ignoreOutput | ||
}) | ||
process.chdir(previousDir) | ||
@@ -98,0 +100,0 @@ return true |
Sorry, the diff of this file is not supported yet
60158
45
844
192