A community Bash framework.
Go to file
Konstantin Gredeskoul b935ddd309
`node_version_prompt` should work without NVM
Adding `node` prompt that does not depend on `nvm` and will work with other version managers as well.

There are now alternative version managers available, such as a much more streamlined [volta.sh](https://volta.sh).  It feels like a deja-vu of `rvm` to `rbenv` switch, all over again.

Regardless, we should be able to show the current `node` version whether you are using NVM, VOLTA or a hot potato.

I decided not to add dedicated PREFIX variables for now, but it can be done later.

We still check if `nvm` prompt returns something first because the `declare` check is practically free, and if it returns something — we use it. Only if the output of NVM is blank do we use the new function to grab the version of NodeJS.

There is a caveat — if `node` is installed with the OS, eg `/usr/bin/node` the new function will now pick up the version of that "system" node and show it. Therefore "system" node version will now be visible in the prompt of those who added `node` component to their prompt. Personally, I believe this is the correct behavior, because why should we hide the system node version if that's what's available and in the PATH? We shouldn't.  In fact, I think it's rather confusing that previously we wouldn't show the system node version at all.

Tested locally on OS-X/bash:

    * with/without NVM
    * with/without VOLTA
    * with/without system node
2021-09-13 00:27:41 -07:00
.github Revert "ci: Remove macos-11.0 as it is unreliable" 2021-09-10 16:54:51 +03:00
aliases/available feat(git): add git unpushed alias (#1897) 2021-06-23 15:02:04 +03:00
completion/available completion/system: update wording on shell version 2021-09-05 15:43:05 -07:00
custom Fix bogus bash binary location 2012-04-17 00:24:58 -04:00
docs move to Libera.Chat 2021-07-06 22:21:46 -05:00
hooks hooks: Use compat31 in check-clean-files-txt.sh 2021-04-22 20:53:30 +03:00
lib lib/log: default to no logging at all 2021-08-26 14:11:41 -07:00
plugins/available plugins: Fix shellcheck warnings on already linted files 2021-09-09 20:57:03 +03:00
scripts use absolute paths instead of changing directory 2021-01-31 15:32:23 -06:00
template add command time duration plugin (#1683) 2020-12-27 18:48:17 +02:00
test Tests for 'default' prefix 2021-08-26 14:11:41 -07:00
test_lib Updated to bats-core v1.2.0 2020-04-29 16:03:30 +02:00
themes `node_version_prompt` should work without NVM 2021-09-13 00:27:41 -07:00
vendor Add "jboss-completion" from "https://github.com/rparree/jboss-bash-completion@master" 2021-02-13 10:34:49 +02:00
.ackrc Ignore the enabled directories when running ack 2016-03-25 15:29:10 -05:00
.editorconfig EditorConfig: don't specify indent size 2021-08-14 20:14:01 -07:00
.gitattributes Allow trailing spaces in md/rst files 2020-12-17 01:42:25 +02:00
.gitignore Squashed 'vendor/github.com/erichs/composure/' content from commit 5c3698d 2021-01-31 14:56:34 +01:00
.gitmodules Updated to bats-core v1.2.0 2020-04-29 16:03:30 +02:00
.pre-commit-config.yaml Merge pull request #1899 from georgettica/georgettica/bump-pre-commit-hooks 2021-06-23 13:21:06 +03:00
.readthedocs.yml Add readthedocs configuration 2020-10-31 23:07:02 +02:00
.shellcheckrc Add simple shellcheckrc 2020-10-28 11:51:04 +02:00
LICENSE Add 2021 to license 2021-04-06 20:59:08 +03:00
bash_it.sh Handle unbound variables 2021-08-26 14:11:41 -07:00
clean_files.txt Merge pull request #1852 from tbhaxor/feature/completion/dart 2021-08-03 23:58:16 +03:00
install.sh install: Dont quote number vars, to support older bash versions 2021-04-01 17:59:59 +03:00
lint_clean_files.sh Explain Bash-it variable clearing in lint script 2020-11-05 08:30:33 -08:00
uninstall.sh Fixed some shellcheck warnings 2018-05-31 18:05:25 +02:00

docs/README.md

logo

Build Status Docs Status License shell Join the chat at https://web.libera.chat/?channel=#bash-it

Bash-it is a collection of community Bash commands and scripts for Bash 3.2+. (And a shameless ripoff of oh-my-zsh 😃)

Includes autocompletion, themes, aliases, custom functions, a few stolen pieces from Steve Losh, and more.

Bash-it provides a solid framework for using, developing and maintaining shell scripts and custom commands for your daily work. If you're using the Bourne Again Shell (Bash) regularly and have been looking for an easy way on how to keep all of these nice little scripts and aliases under control, then Bash-it is for you!
Stop polluting your ~/bin directory and your .bashrc file, fork/clone Bash-it and start hacking away.

Installation

  1. Check out a clone of this repo to a location of your choice, such as git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it
  2. Run ~/.bash_it/install.sh

That's it! 😃

You can check out more components of Bash-it, and customize it to your desire.
For more information, see detailed instructions here.

Contributing

Please take a look at the Contribution Guidelines before reporting a bug or providing a new feature.

The Development Guidelines have more information on some of the internal workings of Bash-it, please feel free to read through this page if you're interested in how Bash-it loads its components.

Contributors

List of contributors

License

Bash-it is licensed under the MIT License.