Commit Graph

3847 Commits (c6ac9109d71e833730149cb723442b17c8458531)

Author SHA1 Message Date
John D Pell c6ac9109d7 lib/theme: parameter cleanup
Improve handling of parameters by adding defaults (often blank).

Alsö, eliminate newlines from `echo` in many places.
2022-03-03 22:54:09 -08:00
John D Pell 2b3af0d8c9 lib/theme: eliminate a lot of subshells
A lot of useless `echo`s in here.
2022-03-03 22:54:09 -08:00
John D Pell ac0d91b682 lib/theme.githelpers: remove dead code
Five years deprecation is plenty warning.
2022-03-03 22:54:09 -08:00
John D Pell 1d73537dbf lib/theme: `shfmt` && `shellcheck`
My apologies to future `git blame` hunters ♥

Use the "short" host name by default (`\h`), not the fully qualified domain name (`\H`)...

lib/theme: don't redefine battery_char()

Combine the two definitions for `battery_char()` so the second one doesn't just overwrite the first one. Do one or the other, not both.

Don't evaluate if `battery_percentage()` is available at load time, evaluate it at run time.

Don't run `date` for `$THEME_TIME_FORMAT`, use `\D{fmt}`.
2022-03-03 22:54:09 -08:00
John D Pell 6bacd5fb1c lib/githelpers: `shfmt` && `shellcheck`
My apologies to future `git blame` hunters ♥
2022-03-03 22:54:08 -08:00
John D Pell fbc5d0a5af lib/p4helpers: `shfmt`
My apologies to future `git blame` hunters ♥
2022-03-03 22:53:13 -08:00
John D Pell 0e0e0d3035 lib/theme: Fix a *few* SC2154
These variables are referenced by themes already linted.
2022-03-03 22:53:13 -08:00
Noah Gorny fdff1d81cd
Merge pull request #2103 from Bash-it/revert-2101-add-bashcov-report
Revert "ci: Add bashcov codecov report"
2022-03-03 22:39:47 +02:00
Noah Gorny 5c592c9a6f
Revert "ci: Add bashcov codecov report" 2022-03-03 22:37:39 +02:00
Noah Gorny 1722ea963e
ci: Add bashcov codecov report (#2101) 2022-03-03 21:37:34 +02:00
Noah Gorny be755d63af ci: Add bashcov codecov report 2022-03-02 23:44:42 +02:00
Ira Abramov be9a838015
Fix knife completion (#2098)
Co-authored-by: Ira Abramov <github@ira.abramov.org>
2022-03-01 23:22:56 +02:00
Noah Gorny 34bc37c178
Merge pull request #2061 from gaelicWizard/lib/helpers
lib/helpers: fixes, improvements, consolations, constellations, and a partridge in a pear tree
2022-03-01 23:21:27 +02:00
John D Pell 789ede9ef3 plugin/battery: fix tests 2022-02-24 12:52:26 -08:00
John D Pell 604f9b0baa Remove executable bit. 2022-02-24 12:47:22 -08:00
John D Pell 47bbc73744 lib/helpers: `_bash-it-find-in-ancestor()`
Use new `composure.sh` feature to avoid `cite()`.
2022-02-24 12:47:22 -08:00
John D Pell 5957d189ea lib/utilities: `_bash-it-component-item-is-enabled()`
- Use normal `if`/`then`
2022-02-20 12:01:05 -08:00
John D Pell fe48deda2d lib: rename `_bash-it-clean-component-cache()`
…to `_bash-it-component-cache-clean()`
2022-02-20 12:01:05 -08:00
John D Pell 6257853759 lib/utilities: use `$XDG_CACHE_HOME` properly
We should fall back to the default location, not use an entirely different one.
2022-02-20 12:01:05 -08:00
John D Pell 72829ca21d lib/utilities: `_bash-it-component-item-is-enabled()`
- required arguments
2022-02-20 12:01:05 -08:00
John D Pell ffcf8f1c94 lib/utilities: >| 2022-02-20 12:01:05 -08:00
John D Pell fbd842b2ea lib/helpers: fix extraneous quotes from `_bash-it-grep()` 2022-02-20 12:01:05 -08:00
Noah Gorny 33bade22b7
Merge pull request #2073 from gaelicWizard/lib/preexec
Update "preexec" from "https://github.com/rcaloras/bash-preexec@master"
2022-02-19 23:56:56 +02:00
Noah Gorny 1c8ad2c1b7
Merge pull request #2096 from akinomyoga/plugin-blesh-workaround-reloader-change
bash_it.sh: source `reloader.bash` without arguments for the default enabling
2022-02-19 23:43:20 +02:00
Koichi Murase ee853670a1 bash_it: suppress a false error by shellcheck 2022-02-19 17:17:45 +09:00
Koichi Murase 41cf3cfaf2 plugin/blesh: override possible arguments inherited by callers 2022-02-19 16:34:22 +09:00
Koichi Murase e05fa477d7 bash_it: source reloader.bash without arguments for the default enabling 2022-02-19 16:34:22 +09:00
John D Pell 150f73ee50 bash-it update: show change log once 2022-02-18 03:06:17 -08:00
John D Pell 2cea663a4a lib/theme: handle undefined parameter 2022-02-18 03:06:17 -08:00
John D Pell 95353f1a98 lib/helpers: the last remnants of the `$OSTYPE` have been swept away
- Figure out which `sed` we have by checking, not guessing.
2022-02-17 20:46:28 -08:00
John D Pell ddf75f17ac lib/search: fix variable scope 2022-02-17 20:46:28 -08:00
John D Pell 35ecc260c2 lib/helpers: handle unbound parameters 2022-02-17 20:46:28 -08:00
John D Pell 31751624c0 lib/helpers: cleanup `_bash-it-profile-load-parse-profile()` a bit 2022-02-17 20:45:37 -08:00
John D Pell e7818dbaca lib/helpers: handle unbound positional parameters
Alsö, don't `pushd`/`popd` when restarting shell.
2022-02-17 20:45:37 -08:00
John D Pell 60c10004d1 lib/helpers: fix `_bash-it-component-pluralize()` 2022-02-17 20:45:27 -08:00
John D Pell 8246794a28 lib/preexec: the last remnants of the `$OSTYPE` have been swept away
- Use a POSIX-compliant/portable extended regular expression to match on word-boundaries, rather than guessing which regex library `bash` was linked against. See https://stackoverflow.com/a/12696899/555333 for explanation and code suggestion.
2022-02-16 16:10:41 -08:00
John D Pell c1943192ce lib/preexec: clarify subshell guard and comment
Rewrite comment on disabling the `DEBUG` trap in subshells, which is now handled upstream as of rcaloras/bash-preexec#26.

Alsö, fix the guard variable assignment to allow it to be overridden elsewhere (e.g., for testing).
2022-02-16 16:10:41 -08:00
John D Pell a93919625d lib/preexec: adobt `_bash_it_library_finalize_hook`
Schedule modification of `$PROMPT_COMMAND` for after everything has loaded.
2022-02-16 16:10:41 -08:00
John D Pell 6b08284928 Update "preexec" from "https://github.com/rcaloras/bash-preexec@master"
git-vendor-name: preexec
git-vendor-dir: vendor/github.com/rcaloras/bash-preexec
git-vendor-repository: https://github.com/rcaloras/bash-preexec
git-vendor-ref: fd2ffa8876d3940c97ffdc3cc807e43277cf72da
2022-02-16 16:10:41 -08:00
Noah Gorny 187916d903
Merge pull request #2047 from gaelicWizard/alias/shfmt
Aliases: lint the entire folder
2022-02-16 22:47:36 +02:00
Noah Gorny caae145f5a
Merge pull request #2068 from gaelicWizard/theme/pure
theme/pure: cleanup
2022-02-16 22:46:59 +02:00
Noah Gorny 379813b671
Merge pull request #2086 from seefood/ira/fix-dirs
Tilde expanstion won't work once it is a quoted string, expanding in advance
2022-02-16 22:45:02 +02:00
Noah Gorny 9d6fe72267
Merge pull request #2088 from gaelicWizard/lib/log
lib/log: //echo/printf
2022-02-16 22:18:22 +02:00
Noah Gorny 0b1c65b100
Merge pull request #2092 from punchagan/link-profile
lib/helpers: Don't rm "$profile_path" before writing to it
2022-02-16 22:14:28 +02:00
Noah Gorny b550b99160
Merge pull request #2091 from gaelicWizard/completion/alias
completion/aliases: redirection, quote, temp file
2022-02-16 22:12:57 +02:00
Puneeth Chaganti b3ef9ea209 lib/helpers: Don't rm "$profile_path" before writing to it
When the file is being re-created, we write to it, instead of appending to
it. So, the rm here is unnecessary and prevents users from linking the profile
file to another location that is potentially under version control. For
instance, once could link to a profile file located at
"$BASH_IT_CUSTOM/profiles/*.bash_it".
2022-02-16 20:55:08 +05:30
John D Pell e7b91e7be5 lib/log: use newly supported `composure.sh` feature
- these functions can now run even if `composure.sh` has *not* been loaded at all!
2022-02-15 22:20:19 -08:00
John D Pell 61b6393a4a lib/log: //echo/printf
- Replace `echo -e` with `printf` in `_bash-it-log-message()`.
- Local positional parameters to allow for defaults.
- Use `if`/`then` properly.
- Clean up use of `$BASH_IT_LOG_PREFIX` slightly (eliminate duplicate colons).
2022-02-15 22:18:24 -08:00
John D Pell 4ba11dbaa2 completion/aliases: redirection, quote
Alsö, some aliases are returned by `alias -p` with `alias -- xxxxx`...which confuses the function, so handle it specially.
2022-02-15 22:09:27 -08:00
Noah Gorny 562eb6ce68
Merge pull request #2083 from tbhaxor/patch-1
Remove redundant aliases for clear screen
2022-02-15 22:47:42 +02:00