Socket
Socket
Sign inDemoInstall

build-ignore

Package Overview
Dependencies
0
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.7 to 1.1.8

2

package.json
{
"name": "build-ignore",
"version": "1.1.7",
"version": "1.1.8",
"description": "A script that generates a .gitignore based on branch name for when different .gitignores are needed",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -24,6 +24,23 @@ # Build-Ignore

Consider using a githooks module like [husky](https://www.npmjs.com/package/husky) to have code run automatically with post-checkout hook.
#Git hooks
Use as a post-checkout git hook to have build-ignore run automatically when changing branches by adding the following to the `.git/hooks` directory:
``` bash
#.git/hooks/post-checkout
#!/bin/sh
BRANCH_SWITCH="$3"
#check if it was a branch checkout
if [[ $BRANCH_SWITCH -eq 1 ]]
then
./node_modules/.bin/build-ignore
fi
```
// Edit package.json
![terminal](https://media.giphy.com/media/OBk7HYOkMCu2Y/giphy.gif)
Alternatively, you can use a githooks module like [husky](https://www.npmjs.com/package/husky) and add the following to your package.json scripts section.
``` json
{

@@ -35,3 +52,1 @@ "scripts": {

```
![terminal](https://media.giphy.com/media/G7VwLIwql0Ai4/giphy.gif)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc