-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wholesale cleanup of nodejs related components
- remove redundant cite - support Basher - add nenv plugin - uplift nodenv to follow newer pattern and standard - ensure node components play well with *env tools
- Loading branch information
1 parent
1882f50
commit 47d5c77
Showing
5 changed files
with
33 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
# shellcheck shell=bash | ||
cite "about-completion" | ||
about-completion "npm (Node Package Manager) completion" | ||
|
||
if _command_exists npm; then | ||
# Test `npm version` because *env tools create shim scripts that will be found in PATH | ||
# but do not always resolve to a working install. | ||
if _command_exists npm && npm --version &> /dev/null; then | ||
eval "$(npm completion)" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# shellcheck shell=bash | ||
about-plugin 'load nenv, if you are using it' | ||
|
||
# Load after basher | ||
# BASH_IT_LOAD_PRIORITY: 260 | ||
|
||
export NENV_ROOT="${NENV_ROOT:-${HOME?}/.nenv}" | ||
|
||
if [[ -d "${NENV_ROOT?}/bin" ]]; then | ||
pathmunge "${NENV_ROOT?}/bin" | ||
fi | ||
|
||
if _command_exists nenv; then | ||
eval "$(nenv init - bash)" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
# shellcheck shell=bash | ||
cite about-plugin | ||
about-plugin 'Node.js helper functions' | ||
|
||
# Check that we have npm | ||
_command_exists npm || return | ||
# Load after *env plugins | ||
# BASH_IT_LOAD_PRIORITY: 270 | ||
|
||
# Ensure local modules are preferred in PATH | ||
pathmunge "./node_modules/.bin" "after" | ||
pathmunge './node_modules/.bin' 'after' | ||
|
||
# If not using nodenv, ensure global modules are in PATH | ||
if [[ ! "$(type -p npm)" == *"nodenv/shims"* ]]; then | ||
pathmunge "$(npm config get prefix)/bin" "after" | ||
# If not using an *env tool, ensure global modules are in PATH | ||
if [[ ! "$(type -p npm)" == *'/shims/npm' ]]; then | ||
pathmunge "$(npm config get prefix)/bin" 'after' | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters