1 alias bi="bower install"
2 alias bisd="bower install --save-dev"
3 alias bis="bower install --save"
5 alias bs="bower search"
7 _bower_installed_packages () {
8 bower_package_list=$(bower ls --no-color 2>/dev/null| awk 'NR>3{print p}{p=$0}'| cut -d ' ' -f 2|sed 's/#.*//')
12 local -a _1st_arguments _no_color _dopts _save_dev _force_latest _production
16 _no_color=('--no-color[Do not print colors (available in all commands)]')
19 '(--save)--save[Save installed packages into the project"s bower.json dependencies]'
20 '(--force)--force[Force fetching remote resources even if a local copy exists on disk]'
23 _save_dev=('(--save-dev)--save-dev[Save installed packages into the project"s bower.json devDependencies]')
25 _force_latest=('(--force-latest)--force-latest[Force latest version on conflict]')
27 _production=('(--production)--production[Do not install project devDependencies]')
30 'cache-clean:Clean the Bower cache, or the specified package caches' \
31 'help:Display help information about Bower' \
32 'info:Version info and description of a particular package' \
33 'init:Interactively create a bower.json file' \
34 'install:Install a package locally' \
35 'link:Symlink a package folder' \
36 'lookup:Look up a package URL by name' \
37 'register:Register a package' \
38 'search:Search for a package by name' \
39 'uninstall:Remove a package' \
40 'update:Update a package' \
41 {ls,list}:'[List all installed packages]'
45 '*:: :->subcmds' && return 0
47 if (( CURRENT == 1 )); then
48 _describe -t commands "bower subcommand" _1st_arguments
66 _bower_installed_packages
67 compadd "$@" $(echo $bower_package_list)
73 _bower_installed_packages
74 compadd "$@" $(echo $bower_package_list)