forked from Bash-it/bash-it
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit 20ede6d
committed
lib/helpers: fix
- Don't write to disk, just pipe.
- Don't loop, just do all functions.
Performance of old implementation on my system:
```
real 0m9.996s
user 0m5.318s
sys 0m9.126s
```
Performance of new implementation on my system:
```
real 0m0.052s
user 0m0.069s
sys 0m0.025s
```
lib/helpers: fix `_command_exists()`
The weird subshell is weird AF. Just do a normal `if`.
Ditto `_binary_exists()`, `_completion_exists()`, and `_is_function()`!
lib/helpers: first `shellcheck` pass
Quote things, SC2268, SC2143, SC2181, SC2162, SC2016, SC2013, &c.
Rewrite globbing per `shellcheck`’s SC2013, and alsö s/typeset/local/g. Eliminate `compgen` where possible.
Alsö: use the existing utility functions `_bash-it-get-component-type-from-path` and `_bash-it-get-component-name-from-path`, which just use parameter substitution anyway. Why was `sed` here?
Alsö, don't add not-existing directories to `$PATH` in `pathmunge()`.
Finally, merge PR Bash-it#1865 from NoahGorny...and clean it a bit...
lib/helpers: second `shellcheck` pass
lib/helpers: lint `_bash-it-migrate()`
lib/helpers: lint `_disable-thing()`
lib/helpers: lint `_enable-thing()`
lib/helpers: lint `_help-list-aliases()`
lib/helpers: lint `_help-plugins()`
lib/helpers: some SC2034 fixes
And SC2154 in `_make_reload_alias()`
lib/helpers: lint `all_groups()`
lib/helpers: `shfmt`
My apologies to future `git blame` hunters ♥
lib/helpers: cleanup
- Improve `pushd`/`popd` somewhat
- local some parameters
- Lose weird Mac-specific alternate shell startup file (Bash loads startup files on Mac the same as it does on any other *nix system.)
lib/helpers: fix `_bash-it-describe()`
Use `_bash-it-component-item-is-enabled()`
Fix SC2295
lib/helpers: be extra careful with word splitting
Use curly braces when `$1` is unseparated from words in a string.
lib/helpers: use `awk` to count lines instead of piping to `wc -l`
Co-authored-by: Kostas Giapis <45879751+tsiflimagas@users.noreply.github.com>
lib/helpers: remove weird non-globs
Replace weird non-globs with array and loop, as suggested by `shellcheck`. Alsö, simplify several constructs to eliminate external binaries.
Alsö, see mvdan/sh issue 558
lib/helpers: unbound positional parameters
lib/helpers: fix profile subcommand tests
plugins/ruby: tests on Mac OS X
Test was failing only on Mac OS X for some reason, so refactor a little.
lib/utilities: fix tests
This subshell is...wut
lib/helpers: juse use `awk`, insteado of `grep | awk`
lib/helpers: simplify some functions
- add some `local` variables,
- don't subshell `_typeset_functions`,
lib/utilities: autonomize `_bash-it-component-item-is-enabled()`
lib/helpers: delete `_bash-it-determine-component-status-from-path()`
Duplicate function of existing `_bash-it-component-item-is-enabled()`.
lib/helpers: quotes for consistency
Quote some parameter uses that don't strictly require it, but since Bash needs so many quotes everywhere else my brain worms feel better when these are quoted too.
lib/helpers: simplify some quote escapes
lib/search: code style cleanup
Couldn't even `shellcheck` until I did a first pass...too much noise! ♥
lib/search: `shellcheck`
SC2076
SC2091
SC2004
SC2086
SC2207
lib/search: fix `_bash-it-flash-term()`
1. `$text_black` isn't a parameter provided by _Bash It_. Typo?
2. `$bold_yellow` is meant for prompt strings and putputs `\[`; ditto `$bold_red`.
3. The color was never returned to normal after.
lib/search: fix usage statement `_bash-it-search()`
SC2154
lib/search: `shfmt`
My apologies to future `git blame` hunters ♥
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#1978.
lib/search: code cleanup
Improve `_bash-it-erase-term()`, `_bash-it-flash-term()`, `_bash-it-rewind()`, `_bash-it-search-result()`, and `_bash-it-search-component()`. Minor tweaks to `_bash-it-is-partial-match()`, and `_bash-it-search()`.all_groups()
1 parent b846c86 commit 20ede6dCopy full SHA for 20ede6d
File tree
12 files changed
+1245
-1239
lines changedFilter options
- lib
- test
- fixtures/go
- go path/bin
- gopath/bin
- gopath2/bin
- lib
- plugins
12 files changed
+1245
-1239
lines changed+2
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
77 | 77 |
| |
78 | 78 |
| |
79 | 79 |
| |
| 80 | + | |
| 81 | + | |
80 | 82 |
| |
81 | 83 |
| |
82 | 84 |
| |
|
0 commit comments