install-deps-postmerge
Install package.json dependencies using npm or yarn as git post merge hook
Last updated a year ago by camacho .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install install-deps-postmerge 
SYNC missed versions from official npm registry.

install-deps-postmerge

Script for installing dependencies using npm or yarn as a postmerge git-hook.

Install

yarn add -D install-deps-postmerge

What does this module do?

This script will git a list of files by running:

git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD

It will take the results and check if package.json, package.lock.json, or yarn.lock is listed.

If any of those files is found, the script will intelligently pick the correct client (based on which lockfile changed and falling back to yarn-or-npm) to install the dependencies.

How do I use it in my project?

It can be used as part of a postmerge npm script alongside 'husky' for githook integrations:

{
  "scripts": {
    "postmerge": "install-deps-postmerge"
  },
  "devDependencies": {
    "install-deps-postmerge": "latest"
  },
  "optionalDependencies": {
    "husky": "latest"
  }
}

Alternatively, if you do not want to use 'husky', the script can be added as a command in the .git/hooks/post-merge file:

npm run -s postmerge
# or
yarn -s postmerge

Requirements

  • node: >=7.6.0

Current Tags

  • 1.0.5                                ...           latest (a year ago)

6 Versions

  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 8
Dependencies (2)

Copyright 2014 - 2016 © taobao.org |