Skip to content

Commit

Permalink
autocomplete for scripts at the top level
Browse files Browse the repository at this point in the history
If scripts are found in a `package.json` file in the current directory,
add them as first-level autocompletions commands.

Example:

package.json
```json
{
    "scripts": {
	"foo": "echo bar"
    }
}
```

`yarn f<tab>` will complete to `yarn foo`
  • Loading branch information
dsifford committed Apr 26, 2017
1 parent 39d08ff commit a9a2c93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yarn-completion",
"version": "0.1.2",
"version": "0.2.0",
"repository": "https://github.com/dsifford/yarn-completion.git",
"description": "shell autocompletion for yarn",
"author": "Derek P Sifford <[email protected]>",
Expand Down
3 changes: 2 additions & 1 deletion yarn-completion.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# shellcheck shell=bash
#
# Version: 0.1.2
# Version: 0.2.0
#
# bash completion for Yarn (https://github.com/yarnpkg/yarn)
#
Expand Down Expand Up @@ -469,6 +469,7 @@ _yarn() {
upgrade-interactive
version
why
$( __yarn_get_package_fields scripts )
)

local global_flags=(
Expand Down

0 comments on commit a9a2c93

Please sign in to comment.