Commit Graph

3841 Commits (014c102b71e026b2c67dd2686583c3aba99ef9a6)

Author SHA1 Message Date
John D Pell 85a77f1e46 lib/colors: Separate metaprogramming 2022-01-28 13:09:53 -08:00
John D Pell bf4ddf5951 plugin/colors: `shfmt` 2022-01-28 13:09:00 -08:00
John D Pell 399f0265aa plugin/colors: revert #699
This reverts commit 2a3fde2b14 but does *not* restore the previous variables. Those are still provided by `lib/colors`.

This plugin exists for anyone who likes the metaprogramming adventure of computing colors dynamically rather than using hard-coded value. Potentially this could be used by themes, or possibly by a theme color-scheme randomizer?
2022-01-28 13:09:00 -08:00
John D Pell 5f19de8d51 plugin/colors: rename `theme/colors` 2022-01-28 13:09:00 -08:00
John D Pell 16cee1956d lib/colors: revert #99
This reverts bash-it/bash-it#99, a metaprogramming adventure in terminal color code escape computation. It was functionally reverted in bash-it/bash-it#699; I'm just finishing the job.
2022-01-28 13:08:50 -08:00
John D Pell 2a8d8ba540 lib/colors: rename `theme/colors` 2022-01-28 13:08:50 -08:00
Nariyasu Heseri b87f3067b5 plugin/battery: bug fix
When `upower --enumerate | grep -i BAT` returns multiple lines of results (which are file paths),
the added quotation (from commit 3cb5f3f7e6) concatenates them all to provide an invalid path.
Thus to make the plugin work as before the commit,
take only the first line of the results.
2022-01-29 03:30:35 +09:00
John D Pell fd7b20b8d7 reloader: `shellcheck` && `shfmt`
Rewrite globbing per `shellcheck`'s SC2013 recommendations, and standardize whitespace.
2022-01-28 03:59:45 -08:00
John D Pell 75d22d865f lib/reloader: adopt `_bash-it-log-prefix-by-path()` 2022-01-28 03:59:45 -08:00
John D Pell c08267e25d lib/helpers: eliminate assumptions about login shells
Bash loads initialization files on Mac just the same as it does on Linux or WSL. Our previous assumptions were wrong, and my fix was alsö wrong because I made more assumptions!

This patch eliminates the assumptions. Literally just load either the startup file the shell started with, or fall back to `~/.bashrc`. Don't check `shopt -q login_shell` and don't check `$OSTYPE` or anything else.
2022-01-28 03:59:02 -08:00
Noah Gorny 7e79212dff
Merge pull request #2072 from gaelicWizard/lib/preexec
lib/preexec: tests!
2022-01-27 23:55:21 +02:00
John D Pell 2343e2dd35 lib/preexec: tests! 2022-01-27 12:40:38 -08:00
John D Pell d1d7cd4383 tests: add *.bats to `.editorconfig` 2022-01-27 11:30:35 -08:00
Noah Gorny 056c392a54 lib: preexec: Properly return if there was a conflict in check_*_conflict
It goes the other way around!
2022-01-26 18:25:37 +02:00
Noah Gorny 0c24edae06
Merge pull request #2064 from gaelicWizard/plugin/battery
plugin/battery: `shellcheck`
2022-01-26 17:47:59 +02:00
Noah Gorny 3c2bc3d196
Merge pull request #2003 from gaelicWizard/preexec
Consolidate `preexec`-related functions; Eliminate `vendor/init.d`
2022-01-26 17:34:46 +02:00
Noah Gorny 5a849419ba
Merge pull request #2040 from gaelicWizard/parallel
CI: install `parallel` on OSX
2022-01-26 17:29:26 +02:00
John D Pell 3cb5f3f7e6 plugin/battery: `shellcheck` 2022-01-25 23:54:24 -08:00
John D Pell eeaf59b439 CI: install `parallel` on OSX
This should (hopefully) speed up tests!
2022-01-25 13:38:41 -08:00
John D Pell ae8c9c08a3 lib/preexec: trim whitespace
Alsö, use `_bash-it-array-contains-element()`
2022-01-25 13:00:04 -08:00
John D Pell 7770e8cbb9 lib/preexec: log an error if `bash-preexec` not loaded 2022-01-25 13:00:04 -08:00
John D Pell 9f146f937a lib/preexec: consolidate helper functions
Define the helper functions for `bash-preexec.sh` immediately after importing it, rather than in `lib/theme`.
- `__check_precmd_conflict()` and `save_append_prompt_command()` are generally useful and not theme-specific.
- Add matching `__check_preexec_conflict()` and `safe_append_preexec()`.
2022-01-25 13:00:04 -08:00
John D Pell 7a0b353cea lib/preexec: rename `vendor/init.d/preexec.bash` 2022-01-25 13:00:04 -08:00
Noah Gorny 2575d64deb
Merge pull request #2010 from gaelicWizard/plugin-projects
Plugin/projects: cleanup
2022-01-25 18:28:53 +02:00
Noah Gorny 44a1b55db7
Merge pull request #2037 from gaelicWizard/theme/brunton
theme/brunton: `shellcheck`
2022-01-25 18:18:54 +02:00
Noah Gorny 878bbe5942
Merge pull request #2042 from gaelicWizard/completion/dotnet
completion/dotnet: new completion
2022-01-25 18:16:06 +02:00
Noah Gorny dd83efc35f
Merge pull request #2041 from gaelicWizard/theme/sudo
lib/theme: disable THEME_CHECK_SUDO
2022-01-25 18:12:47 +02:00
Noah Gorny 035eabade6
Merge pull request #2036 from gaelicWizard/theme/norbu
theme/norbu: `shellcheck` && `shfmt`
2022-01-25 18:10:21 +02:00
Noah Gorny 80c52b4c25
Merge pull request #2049 from gaelicWizard/CI
CI: fix version of OSX runner
2022-01-25 18:07:46 +02:00
Noah Gorny dcb7038ca3
Merge pull request #2034 from gaelicWizard/README
README: Display latest build status from default branch
2022-01-25 17:57:06 +02:00
Noah Gorny 457a279263
Merge pull request #2029 from gaelicWizard/completion/bash-it
completion/bash-it: lint and simplify
2022-01-25 17:56:34 +02:00
John D Pell b1e922ea38 theme/norbu: `shellcheck` && `shfmt`
# Conflicts:
#	clean_files.txt
2022-01-25 00:01:27 -08:00
John D Pell 4779c8c380 README: Display latest build status from current branch
This displays the build/test status of the latest commit to HEAD, not neccessarily `master` branch, from whichever fork it's read from.
2022-01-24 21:53:57 -08:00
John D Pell 5f9a3f143f completion/bash-it: rename `_bash-it-comp()`
...to `_bash-it()`.

The norm is for the completion function for, e.g., `teh_cmd`. to be named with the same name and a prepended underscore, i.e. `_teh_cmd`. This alsö reduces namespace confusion, which will be relevant in a future patch.
2022-01-24 21:41:23 -08:00
John D Pell 2f4ed49a71 completion/bash-it: adopt `_compreply_candidates()` 2022-01-24 21:41:13 -08:00
John D Pell e1e971c0ea completion/bash-it: use `read -a` to populate `$COMPREPLY`
This allows for spaces and special characters in file names, i.e. internaltional/unicode words.
2022-01-24 21:41:13 -08:00
John D Pell 3874ad85c2 completion/bash-it: use existing functions 2022-01-24 21:41:13 -08:00
John D Pell d7695d5456 completion/bash-it: `shfmt` 2022-01-24 21:41:13 -08:00
Noah Gorny dbb3ea4736
Merge pull request #2035 from gaelicWizard/theme/pete
theme/pete: `shellcheck` && `shfmt`
2022-01-24 23:32:58 +02:00
Noah Gorny edc36795b5
Merge pull request #2030 from gaelicWizard/bats
Update BATS
2022-01-24 23:29:00 +02:00
Noah Gorny 7e54aea8c7
Merge pull request #1934 from gaelicWizard/helpers
lib/helpers: lint, cleanup, & improvements
2022-01-24 23:28:03 +02:00
Noah Gorny 4ba1ab9fd7
Merge pull request #2018 from gaelicWizard/lib/helpers-base
lib/helpers: fix `_command_exists()`
2022-01-24 23:27:05 +02:00
John D Pell 18536ed892 template: Add `$THEME_CHECK_SUDO` 2022-01-24 11:46:16 -08:00
John D Pell 21942f6275 lib/theme: disable THEME_CHECK_SUDO
Move `$THEME_CHECK_SUDO` to `lib/them`, and set it to `false` instead of `true`.
2022-01-24 11:46:16 -08:00
souhaiebtar a312e5a9b9
fix wrong function name in `helpers.bash`
when i tried to install, i got a message `_bash-it-pluralize-component` command not found; after checking `utilities.bash` the correct function name was `_bash-it-component-pluralize`
2022-01-22 12:33:33 +00:00
John D Pell a78d72eed1 plugin/projects: refactor a bit 2022-01-18 20:47:08 -08:00
John D Pell 46df804ad9 CI: fix version of OSX runner
Now that Mac OS X is "version 11", the "minor" version is no longer relevant.

Alsö, clean up the run conditions.
2022-01-18 16:36:19 -08:00
John D Pell 1ec48c8d71 plugin/projects: add to `template/bash_profile` 2022-01-18 11:08:51 -08:00
John D Pell ea2002a2e4 plugin/projects: cleanup
I'm deliberately leaving the possibility that one might `pjo` without a project name...
2022-01-18 11:08:51 -08:00
John D Pell 0f0093dd4b 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
2022-01-18 11:06:21 -08:00