greenkeeper-lockfile
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -11,2 +11,8 @@ const exec = require('child_process').execSync | ||
const setPrefixYarn = prefix => prefix === '~' | ||
? '--tilde' | ||
: prefix === '' | ||
? '--exact' | ||
: '' | ||
module.exports = function updateLockfile (dependency, options) { | ||
@@ -22,3 +28,5 @@ if (!options.yarn && semver.lt(exec('npm --version').toString().trim(), '3.0.0')) { | ||
const flag = flags[dependency.type] | ||
const prefix = `--save-prefix="${dependency.prefix}"` | ||
const prefix = options.yarn | ||
? setPrefixYarn(dependency.prefix) | ||
: `--save-prefix="${dependency.prefix}"` | ||
@@ -25,0 +33,0 @@ const args = `${flag} ${prefix} ${dependency.name}@${dependency.version}` |
{ | ||
"name": "greenkeeper-lockfile", | ||
"description": "Your lockfile, up to date, all the time", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"author": "Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)", | ||
@@ -6,0 +6,0 @@ "bin": { |
# greenkeeper-lockfile | ||
> Enabling lockfile support for Greenkeeper via your own CI | ||
After [enabling Greenkeeper for your repository](https://github.com/integration/greenkeeper) you can use this package to make it work with lockfiles, such as `npm-shrinkwrap.json`, `package-lock.json` or `yarn.lock`. | ||
 | ||
[](https://greenkeeper.io/) | ||
@@ -12,8 +14,5 @@ [](https://travis-ci.org/greenkeeperio/greenkeeper-lockfile) | ||
[](https://nodei.co/npm/greenkeeper-lockfile/) | ||
## Package Managers | ||
* ✅ npm | ||
* ✅ npm5 | ||
* ✅ npm _(including npm5)_ | ||
* ✅ yarn | ||
@@ -29,10 +28,8 @@ | ||
1. This script detects whether it's running on a Greenkeeper created branch | ||
2. If so it updates the lockfile with the latest version of the updated dependency | ||
3. It pushes the commit with the updated lockfile back to the Greenkeeper branch/pull request | ||
1. Detect whether the current CI build is caused by Greenkeeper | ||
2. Update the lockfile with the latest version of the updated dependency [using the package manager’s built in mechanism](lib/update-lockfile.js) | ||
3. Push a commit with the updated lockfile back to the Greenkeeper branch | ||
## Setup | ||
After [enabling Greenkeeper for your repository](https://github.com/integration/greenkeeper) you can use this package to make it work with lockfiles, such as `npm-shrinkwrap.json`, `package-lock.json` or `yarn.lock`. | ||
**First [create a GitHub access token with push access to your repository](https://github.com/settings/tokens) and make it available to your CI's environment as `GH_TOKEN`**. | ||
@@ -39,0 +36,0 @@ |
12997
186
116