-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wholesale cleanup of nodejs related components #1990
Open
cornfeedhobo
wants to merge
2
commits into
Bash-it:master
Choose a base branch
from
cornfeedhobo:node-env
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 'Node.js environment management using https://github.com/ryuone/nenv' | ||
|
||
# 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
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,31 +1,13 @@ | ||
# shellcheck shell=bash | ||
# | ||
# BASH_IT_LOAD_PRIORITY: 225 | ||
# | ||
# Bash-it no longer bundles nvm, as this was quickly becoming outdated. | ||
# Please install nvm from https://github.com/creationix/nvm.git if you want to use it. | ||
about-plugin 'Node.js version manager, https://github.com/nvm-sh/nvm' | ||
|
||
cite about-plugin | ||
about-plugin 'node version manager configuration' | ||
# Load after basher | ||
# BASH_IT_LOAD_PRIORITY: 260 | ||
|
||
export NVM_DIR="${NVM_DIR:-$HOME/.nvm}" | ||
# This loads nvm | ||
if _bash_it_homebrew_check && [[ -s "${BASH_IT_HOMEBREW_PREFIX}/nvm.sh" ]] | ||
then | ||
source "${BASH_IT_HOMEBREW_PREFIX}/nvm.sh" | ||
else | ||
[[ -s "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh" | ||
fi | ||
export NVM_DIR="${NVM_DIR:-${HOME?}/.nvm}" | ||
|
||
if ! _command_exists nvm | ||
then | ||
function nvm() { | ||
echo "Bash-it no longer bundles the nvm script. Please install the latest version from" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what about logging a warning in the case we dont find |
||
echo "" | ||
echo "https://github.com/creationix/nvm.git" | ||
echo "" | ||
echo "if you want to use nvm. You can keep this plugin enabled once you have installed nvm." | ||
} | ||
|
||
nvm | ||
if _bash_it_homebrew_check && [[ -s "${BASH_IT_HOMEBREW_PREFIX?}/nvm.sh" ]]; then | ||
source "${BASH_IT_HOMEBREW_PREFIX?}/nvm.sh" | ||
else | ||
[[ -s "${NVM_DIR?}/nvm.sh" ]] && source "${NVM_DIR?}/nvm.sh" | ||
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt we still check this?