Commit Graph

3812 Commits (35ecc260c24f745d035b481f1714d3bbc4b4136c)

Author SHA1 Message Date
John D Pell c3eaa606de lib/utilities: fix `_bash-it-component-help()` for long component names
Alsö, minor tweak to `_bash-it-array-contains-element()` for clarity.

This fixes Bash-It/bash-it#1978.
2022-01-09 00:53:39 -08:00
John D Pell e3bd30f98d lib/utilities: autonomize `_bash-it-component-item-is-enabled()`
Make `_bash-it-component-item-is-enabled()` operate *without* using `_bash-it-component-help()`...so it's now *much* faster.
2022-01-09 00:53:39 -08:00
John D Pell e71ea4ad02 lib/log: function `_bash-it-log-prefix-by-path()`
...to replace `_set-prefix-based-on-path()` in `scripts/reloader`.

Deliberately does not use `_bash-it-get-component-name-from-path()`/`_bash-it-get-component-type-from-path()` as we need some of the intermediate state and would have to reimplement anyway.
2022-01-09 00:49:44 -08:00
John D Pell 6dec28b5df lib/log: rename `_log_general()`
...to `_bash-it-log-message()`.

alsö, add common log levels with common names.
2022-01-09 00:49:44 -08:00
John D Pell b772e6ace7 lib/log: `shellcheck` && `shfmt`
Alsö, fix tests to load `lib/colors` instead of `lib/appearance`...wut

Alsö, `short-circuit _has_colors()`: If we already looked up colors, and we already have them, then don't run `tput` again.

My apologies to future `git blame` hunters ♥
2022-01-09 00:49:44 -08:00
John D Pell dc45958a8e finalize: first attempt at documentation? 2022-01-09 00:46:51 -08:00
John D Pell bdaf29f84c Create lib finalize hook
Create an array `_bash_it_library_finalize_hook` and loop at the end of the main `bash_it.sh` to run each element in the array.

The purpose here is to run some command after everything else has been loaded. For example, the appearance lib checks for executables for SCM commands, but `$PATH` may be altered after appearance has loaded and therefore some available commands may never be discovered. Therefore, create `_bash_it_appearance_scm_init()` and add it to the hook. It will re-check at end of `bash_it.sh` just before prompt is first displayed.
2022-01-09 00:46:51 -08:00
John D Pell 6e480d7a8a plugin/proxy: `shellcheck` && `shfmt`
plugins/proxy: use `_command_exists()`

Alsö, quote variables, handle unbound parameters, &c.
2022-01-09 00:40:49 -08:00
Noah Gorny 86c1e3c043
Merge pull request #1980 from gaelicWizard/themes-SC2154-B
Themes: `shellcheck` (SC2154); Part B
2022-01-09 01:13:49 +02:00
Noah Gorny f2bff34493
Merge pull request #2013 from gaelicWizard/completion/system
completion/system: load earlier than others
2022-01-09 01:13:23 +02:00
Noah Gorny 1fd601db7f
Merge pull request #2007 from gaelicWizard/plugin-latex
Plugin/LaTeX: 2009 was thirteen years ago
2022-01-09 01:11:41 +02:00
Noah Gorny 21e7c1f00c
Merge pull request #2011 from gaelicWizard/plugin-nginx
plugin/nginx: cleanup
2022-01-09 01:11:06 +02:00
Noah Gorny af801cfadc
Merge pull request #2014 from gaelicWizard/plugin/gif
plugin/GIF: use `type -p` and lint
2022-01-09 01:10:43 +02:00
Noah Gorny 46f343461c
Merge pull request #1953 from gaelicWizard/SVN
completion/svn: import existing, remove copy
2022-01-09 01:10:16 +02:00
Noah Gorny 4ec1b5f3e7
Merge pull request #2002 from gaelicWizard/bats
tests: path quoting and boilerplate
2022-01-09 01:04:12 +02:00
John D Pell fcbe4e90b7 theme/easy: SC2154
Handle all unbound parameters, even colors!
2022-01-08 08:45:52 -08:00
John D Pell c7c447a54b theme/candy: SC2154
Handle all unbound parameters, even colors!
2022-01-08 08:45:52 -08:00
John D Pell 262e55eda2 theme/bobby: SC2154
Handle all unbound parameters, even colors!
2022-01-08 08:45:52 -08:00
John D Pell 6db5f38f6e theme/atomic: lint/cleanup
Use `[[` instead of `[`, set some local variables, still more to clean
2022-01-08 08:45:35 -08:00
John D Pell 079652e6e7 plugin/nginx: cleanup
Dont overwrite user-set variable, and quote path. Local some variables, `shellcheck`, `shfmt`
2022-01-08 08:44:05 -08:00
John D Pell 2fe9e01051 plugins/latex: 2009 was 12 years ago
Locate the currently installed edition, instead of transpoting us back to undergrad.
2022-01-08 08:43:32 -08:00
John D Pell ce22710e00 plugin/gif: `shfmt`
My apologies to future `git blame` hunters ♥
2022-01-08 08:43:17 -08:00
John D Pell b1b08de626 plugins/gif: use `type -p` 2022-01-08 08:43:00 -08:00
John D Pell 04c7424de5 completion/system: fix tests for `profile` command 2022-01-08 08:33:16 -08:00
John D Pell 5fab574bfd completion/system: `shfmt`
My apologies to future `git blame` hunters ♥
2022-01-08 08:33:16 -08:00
John D Pell e7c3263f12 completion/system: load earlier than other completions
I chose `325` so that it's still possible to deliberately place something *before* this component, if needed somehow.
2022-01-08 08:33:16 -08:00
John D Pell 776d0b7d37 completion/svn: rename to match prior file
This way, users don't need to enable "subversion" if they had already enabled "svn".
2022-01-08 08:32:37 -08:00
John D Pell ae5131aee2 completion/subversion: load system completion
Load the completion script from the subversion package installed on the system, instead of bundling a copy. This addresses Bash-it/bash-it#1818.

NOTE: If `completions/system` is enabled, then it will load this same file anyway automatically.
2022-01-08 08:32:37 -08:00
John D Pell bb69edd795 completion/subversion: remove
Remove duplicate of subversion completion as it is already provided by system packages.
2022-01-08 08:32:37 -08:00
John D Pell 8a226a73f1 test/test-helper: support 'plumbing' metadata 2022-01-08 08:29:13 -08:00
John D Pell 30ca1bfba2 test/test_helper: exclude bad symlink
Symlink `/test_lib/bats-core/test/fixtures/parallel/suite/helper.bash` references a not-existing file, but it's in a submodule so I can't just fix it. Exclude it from `rsync` in `setup_test_fixture()`.
2022-01-08 08:29:13 -08:00
John D Pell 97ef5a8087 test/run: lint 2022-01-08 08:29:13 -08:00
John D Pell 61e1d6aec2 lib/utilities: simplify test flow
This subshell is...wut
2022-01-08 08:29:13 -08:00
John D Pell c35ed44cbf plugins/ruby: tests on Mac OS X
Test was failing only on Mac OS X for some reason, so refactor a little. It turned out to be due to explicitly setting `$HOME` *after* loading the plugin.
2022-01-08 08:29:13 -08:00
John D Pell 21a2198a12 test/theme: make fewer assumptions
Literally copying a line from the source to be tested is perhaps not the best way to test that code. 😉

That said, we do want to verify that the function was actually loaded.

TODO: actually test the function.
2022-01-08 08:29:13 -08:00
John D Pell 6030767b4e test/theme: load colors 2022-01-08 08:29:13 -08:00
John D Pell da6b27166f tests: new file `test_helper_libs.bash`
For testing non-core files, just `load ../test_helper_libs` after `load ../test_helper` instead of trying to guess which libs must be loaded, in which order, for testing to succeed.

`_command_exists` spews log messages, so our test log is littered with `_log_debug not found`. This fixes that too.
2022-01-08 08:29:13 -08:00
John D Pell 9dcbeec7ad tests: test_helper already loads `composure.sh`
...and `cite()`s metadata
2022-01-08 08:29:13 -08:00
John D Pell b2279b7237 tests: quote paths 2022-01-08 08:29:13 -08:00
Noah Gorny b846c86dbb
Merge pull request #1991 from noviicee/issue-1206
Added alias ls='ls -F'
2022-01-07 09:10:44 +02:00
Noah Gorny 2e968c459c
Merge pull request #1989 from tsiflimagas/bashit-completions-performance
Bash-it completions performance improvement
2022-01-07 08:55:46 +02:00
Noah Gorny 6fc47a7671
Merge pull request #2021 from NariyasuHeseri/master
theme/powerline: fix error `scm: parameter not defined`
2022-01-07 08:51:00 +02:00
Noah Gorny 931f27ee3e
Merge pull request #2016 from gaelicWizard/plugin/python
plugin/python: OS detection & `shfmt`
2022-01-07 08:50:07 +02:00
Noah Gorny 2728f20354
Merge pull request #2012 from gaelicWizard/theme/essential
theme/essential: cleanup
2022-01-07 08:48:16 +02:00
Noah Gorny a538844c3b
Merge pull request #1997 from georgettica/patch-1
feat(git): make auto squashing non-interactive
2022-01-07 08:46:58 +02:00
Noah Gorny c060eb46ea
Merge pull request #2001 from gaelicWizard/plugin-dirs
Plugin/dirs: use `$XDG_STATE_HOME`
2022-01-07 08:42:24 +02:00
Noah Gorny dba610cdc8
Merge pull request #2009 from gaelicWizard/plugin-man
Plugin/man: Add `R` to `$LESS`
2022-01-07 08:41:41 +02:00
Noah Gorny 5d68fca7e5
Merge pull request #2008 from gaelicWizard/plugin-osx
Plugin/OSX: cleanup
2022-01-07 08:41:17 +02:00
Noah Gorny 48a1ff7fb4
Merge pull request #2005 from gaelicWizard/plugin-todo
Plugin/todo: cleanup and simplify
2022-01-07 08:40:52 +02:00
Noah Gorny 682b51c195
Merge pull request #2015 from gaelicWizard/plugin/git-subrepo
plugin/git-subrepo: use `$HOME` instead of `~`
2022-01-07 08:31:49 +02:00