bower-ignore v0.3.2
Bower Ignore
A simple CLI tool to gitignore
useless files of bower dependencies
Installation
npm install bower-ignore -g
Glossary
- ignores: JSON object named "dependencies-gitignore" (by default) in
bower.json
, which looks like:
"dependencies-gitignore": {
"bootstrap": {
"ignore": ["*", "dist/css/*.map"],
"unignore": ["dist/*"]
}
}
package: Generally the name of a repository appeared in
bower.json
, which has been installed with bower.formulae: Collection of polular packages ignores, hosted on GitHub: github.com/mdluo/bower-ignore-formulae
📢 Contribution wanted! Go >>
- gitignore: Plain text in
.gitignore
, generated based on ignores. For each package in ignores, thebdgi git
command takes elements fromignore
Array andunignore
Array by turns and prefixbower_components
path and package name to them. And then write the multiline text to.gitignore
.
# Generated by bower-ignore, please DO NOT modify
# = Bower Ignore Begin
bower_components/bootstrap/*
!bower_components/bootstrap/dist/*
bower_components/bootstrap/dist/css/*.map
# = Bower Ignore End
Usage
Example
Add and set "dependencies-gitignore" (i.e. ignores, hereinbelow) based on "dependencies" in bower.json
:
bdgi json
Add or replace (if ignores already exists) ignores based on "dependencies" packages in bower.json
:
bdgi json -f
Download and replace ignores based on "dependencies" packages in bower.json
:
bdgi json -df
Download jquery
and moment
formulae and set. Skip if packages already exist in ignores:
bdgi json jquery moment -d
Sometimes you may need to edit the ignores part of your
bower.json
to meet your dependencies tree.
Setup ignores in bower.json
and add ignores and unignores to .gitignore
:
bdgi json -d && bdgi git
Command Line Usage
Usage: bdgi <cmd> [options] [packages...]
Commands:
json|j [options] [packages...] add and set "dependencies-gitignore" in bower.json
git|g [options] add ignores and unignores to .gitignore based on ignores in bower.json
Options:
-h, --help output usage information
-V, --version output the version number
Future features
Resolve packages dependencies tree and add ignores automaticly.
Watch file change and take reactions.
Add version support to packages.
Contributing
Feel free to submit pull requests, open issues if you have any question to ask or bug to report. Or, just help to improve this README.md
file and messages in bin/bdgi
.