Commit Graph

82 Commits (c90a6283ef3c8aa945806db392a74b658962a86f)

Author SHA1 Message Date
John D Pell cace3a591d main: use `_command_exists`
Addresses bash-it/bash-it#1632
2021-09-19 21:58:48 -07:00
John D Pell 1c3cbf7ca6
Delete `.shellcheckrc` (#1947)
* CI: disable Ubuntu 16.04 as it's EOL

https://github.blog/changelog/2021-04-29-github-actions-ubuntu-16-04-lts-virtual-environment-will-be-removed-on-september-20-2021/

* main: lint false positive

* install: lint

* plugins/cmd-returned-notify: don't `export`

* plugins/xterm: lint

* plugins/git: lint

* plugins/goenv: lint

* plugins/alias-completion: lint false positives

* plugins/alias-completion: fix SC2155, SC2154

Declare `locals` at the top of the function

* completion: lint completions using `bash_completion` functions

Match the style of the existing code

* completion/knife: lint false positives

* completion/knife: lint

* completion/sdkman: lint

* completion/composer: lint

* Move `.shellcheckrc` under `themes/`

* lib/theme: fix SC2155, SC2154, SC2034

* lib/colors: don't warn on unused variables

We assign a large number of variables here and they may or may not be used anywhere else, so disable SC2034 for this file (only).

Alsö disable SC2005 as the functions in this file were written before `printf` was invented and have to do some fancy metascripting to get escape sequences interpreted reliably. I’m not smart enough to fix this to use `printf`, so leave it for now.

* themes/agnoster: lint

* themes: disable SC2154 for colors

Each one of these themes will need it’s own fix for SC2154, possibly upstream.

Due to the way themes are, it's entirely normal to have a *lot* of false positives for SC2034. So much so, that I have to admit that it is probably just not worth linting for SC2034 despite my dislike of blanket ignore rules.

* themes: disable SC2154, fix SC2155

Each one of these themes will need it’s own fix for SC2154, possibly upstream.

Due to the way themes are, it's entirely normal to have a *lot* of false positives for SC2034. So much so, that I have to admit that it is probably just not worth linting for SC2034 despite my dislike of blanket ignore rules.

* Delete `.shellcheckrc`

* remove executable bit
2021-09-18 12:50:59 +03:00
John D Pell f71fa5be2c Handle unbound variables
Handle BASH_IT, BASH_IT_OLD_BASH_SETUP, BASH_IT_THEME, BASH_THEME, and PROMPT.
2021-08-26 14:11:41 -07:00
John D Pell 5001995e92 Deal with unabound BASH_IT_RELOAD_LEGACY 2021-08-26 14:11:41 -07:00
buhl 49d7d2e8c4 Getting Bash-it to use the vendored composure
Fixed tests
Fixed install.sh and bash_it.sh
Added gitattributes to the vendor folder
Changed documentation
2021-02-02 16:34:04 +01:00
buhl 29855ed1e6 Adding preexec as a vendored library
Added a vendored lib loading routine in bash-it.sh
Added documentation on how to vendor libs in bash-it
Added and fixed plugins using preexec
Added tests for two plugins
Removed the old preexec lib
2021-01-23 18:31:18 +01:00
BarbUk 13e795c995
add command time duration plugin (#1683) 2020-12-27 18:48:17 +02:00
Nils Winkler e0ee6bd32f
Added missing colon and space while loading custom files
Looks like I missed this during my review, @NoahGorny
2020-07-07 13:17:17 +02:00
Noah Gorny 811c9ecd71 bash-it: Reorder main bash-it.sh so logs can happen 2020-07-02 20:13:57 +03:00
Noah Gorny 453c17de3d bash-it: Add logs to bash-it.sh 2020-06-30 20:58:09 +03:00
Travis Swicegood 2d6085b033 Switch from false to skip – I think that's more clear 2018-12-05 21:58:13 -06:00
Travis Swicegood 286e695910 Ensure that shellcheck can find these files (SC1090) 2018-12-05 20:59:37 -06:00
Travis Swicegood e5b68695c0 Attempt to simplify by not using aliases 2018-12-04 22:02:10 -06:00
caguettaz f06439edc3 [cleanup] Harmonized variable names, added support for global config files 2018-12-04 14:30:11 +01:00
Christophe Aguettaz 1ba023c97a [bugfix][wip] Fixed issue with Debian's bash-completion 2018-11-23 22:25:14 +01:00
daniel.schroeder b03a93cd2b
disable theming by checking theme var for value 2018-11-02 10:47:55 +01:00
Nils Winkler 5d99d6cb9b Fixed some shellcheck warnings
Also fixed one broken case of `unset`.
2018-05-31 18:05:25 +02:00
Nils Winkler 0028dc7661 Fixed indentation to two spaces, like in the rest of the file 2018-05-31 17:57:09 +02:00
Piotr Rogoża b288ecbd27 Added legacy alias reload: https://github.com/Bash-it/bash-it/issues/1120#issuecomment-354376835 2018-04-25 19:53:06 +02:00
Piotr Rogoża 89d1661d23 Replaced reload section with proper function.
Added completion for reload.
Fixed order in completion
Added unit tests for completion
The variable BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE has to be unset.
2018-04-18 21:51:20 +02:00
Piotr Rogoża b1dbf2f7e0 Added additional parameter for bash-it: reload
Added creating an alias if command does not exist
2018-04-18 21:51:20 +02:00
Shashank Bharadwaj 353cb210d4 Add priliminary support for perforce SCM
This patch adds very simple support for the Perforce SCM:
    https://www.perforce.com/

Although perforce is proprietary software, it's somewhat prevalent in enterprise
companies. This patch looks to provide some basic bash_it functionality that
I've come to love for git. I base everything off of two perforce commands:
    $ p4 set
This command does not require a connection the perforce server, it simply tells
us if a directory is managed by the Perforce SCM or not. In addition the
command:
    $ p4 opened

is used to provide the list of pending changes in the client and the number of
opened files in the client. The `p4 opened` command requires a connection to the
perforce server, hence it's run under a `timeout` command. The "p4 opened"
processing into it's own bash file that now has to be sourced at the top-level
bash-it.sh. Since the processing in simple the newly added: _p4-opened-counts
function returns a number of things that are not currently used, but since I had
awk open and doing the processing, I've chosen to include them in the output
anyway.

Testing:
  - Tested with the powerline-multiline theme in a few perforce based
    workspaces/clients
  - Ran:
      ❯ shellcheck themes/p4helpers.theme.bash
    and fixed all the errors
  - Ran the test suite:
      ❯ test/run
      [...]
      182 tests, 0 failures, 1 skipped
2018-02-14 17:53:09 -08:00
Dan Wendorf 150e82b221 Refactor git functionality into githelpers.theme.bash
- Add unit tests around git functionality
2017-12-18 09:05:33 -08:00
Nils Winkler a75a53b786 Merge pull request #1043 from nwinkler/enabled-global
Move enabled components to a global directory
2017-09-28 08:05:58 +02:00
pmoranga 0fc26dfad2 Add some description 2017-09-22 12:24:15 +02:00
Nils Winkler 0fe2710c61 More unit tests for loading from global directory structure 2017-09-17 21:05:59 +02:00
Nils Winkler fd637a3dc6 Loading components from global enabled directory 2017-09-17 21:05:59 +02:00
Nils Winkler fb6fcaeb06 Fixed test case where the bash_it.sh would fail with a non-zero return value
This was caused by the way the check for installed preview apps was handled.
2017-09-17 21:05:59 +02:00
Nils Winkler 2acb87e882 Fixed some more shellcheck complaints 2017-09-17 21:05:58 +02:00
Nils Winkler 6981fa091d Add tests for bash_it.sh script 2017-09-17 21:05:58 +02:00
Nils Winkler e53b5dc96e Add some TODO items 2017-09-17 21:05:58 +02:00
pmoranga f65133ac11 Fix execution of trap DEBUG on subshells 2017-09-15 16:06:12 +02:00
Rodrigo Lanza 3e60efd19d Recursive load of out of place custom config files 2017-09-14 22:50:52 +02:00
Nils Winkler 228b86f3d1 Change order of theme loading
The base theme is now loaded after plugins, since it now uses the
`command_exists` function, which is defined in the `base` plugin.
2017-06-24 17:31:31 +02:00
Adam Karim a896cb2c44 Allow for having custom scripts outside of bash-it. 2016-11-29 09:21:26 -08:00
raphaelehret 6c5e1c9dfb Replaced backticks with `$()` 2016-11-28 14:07:16 +01:00
MunifTanjim 6a601abc84 fix npm completion 2016-10-28 02:37:07 +06:00
Ron Waldon 14525efefa load theme _after_ loading any plugins, etc 2016-05-25 17:32:33 +10:00
Fahad Hossain a8124a02e8 Fix unicode line wrap problem (issue #409)
Fix unicode line wrap issue mentioned in #409
Nota bene, This fixed the problem for me on Fedora 21 and Ubuntu 15.04
Needs to be tested on other systems
2015-05-06 22:37:24 +06:00
Benjamin Brombach 4510c9ee63 fixes #343 by surrounding $HOME (which can have spaces) with quotations marks 2015-04-29 14:56:46 +02:00
Nils Winkler 95014c5ed5 Update bash_it.sh
Fixed file name after renaming.
2015-03-29 12:31:06 +02:00
Nils Winkler 27ec876a10 Fixed reload alias.
Using the same logic as in the install script.
2015-03-10 07:06:37 +00:00
Charles Celerier 75d31a07bb bash_it.sh: Patched changes made to support custom.*.bash files.
Code was added to support loading
custom.{aliases,completion,plugins}.bash from their respective
directories in 46f6701a3. The change made in that commit does not wait
until the enabled {aliases,completion,plugins}/*.bash files are loaded
before sourcing the custom.*.bash files, which was the case before. This
patch fixes any issues caused by that change by loading the enabled
*.bash files and custom *.bash files in two successive for loops.
2014-04-28 13:03:47 -04:00
Charles Celerier 46f6701a3f bash_it.sh: Added support for custom.plugins.bash and custom.completion.bash. 2014-04-23 20:13:29 -04:00
Nils Winkler be20972cf0 Merged @erichs changes for the bash-it function. 2012-05-23 09:45:36 +02:00
Erich Smith 1920629d1a update help documentation 2012-05-13 22:13:54 -04:00
Erich Smith a8fcf9f18c import composure functions 2012-04-28 00:02:31 -04:00
Eitan Adler 3fc60b5358 Fix bogus bash binary location 2012-04-17 00:24:58 -04:00
Travis Swicegood b524bb6047 Extract loading of enable-able files and add reload_* functions 2012-03-26 11:19:38 -05:00
Travis Swicegood b59ee658f7 Make sure that the new BASH_IT/BASH_IT_THEME maintains BC 2011-10-29 18:56:36 -05:00