2.0.1 • Published 4 years ago

install-deps-postmerge v2.0.1

Weekly downloads
2,115
License
MIT
Repository
github
Last release
4 years ago

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:

{
  ...
  "husky": {
    "hooks": {
      "post-merge": "install-deps-postmerge"
    }
  },
  "devDependencies": {
    "husky": "latest",
    "install-deps-postmerge": "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:

# abbreviated command "idpm"
npm run -s idpm
# or
yarn -s idpm

Requirements

  • node: >=10
2.0.1-alpha5

4 years ago

2.0.1-alpha4

4 years ago

2.0.1-alpha7

4 years ago

2.0.1-alpha6

4 years ago

2.0.1-alpha3

4 years ago

2.0.0-alpha8

4 years ago

2.0.1

4 years ago

2.0.1-alpha2

4 years ago

2.0.1-alpha1

4 years ago

2.0.0

4 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago