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
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
John D Pell
dfc3fa4339
lib/helpers: delete `_bash-it-determine-component-status-from-path()`
...
Duplicate function of existing `_bash-it-component-item-is-enabled()`.
2022-01-18 11:06:21 -08:00
John D Pell
62b5297dc2
lib/utilities: autonomize `_bash-it-component-item-is-enabled()`
2022-01-18 11:06:21 -08:00
John D Pell
22b290b94f
lib/helpers: simplify some functions
...
- add some `local` variables,
- don't subshell `_typeset_functions`,
2022-01-18 11:02:37 -08:00
John D Pell
bc25810069
lib/helpers: juse use `awk`, insteado of `grep | awk`
2022-01-18 11:02:37 -08:00
John D Pell
805eab804c
lib/helpers: fix profile subcommand tests
2022-01-18 11:02:37 -08:00
John D Pell
4719e43d0b
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
2022-01-18 11:02:37 -08:00
John D Pell
251e23a3fa
lib/helpers: use `awk` to count lines instead of piping to `wc -l`
...
Co-authored-by: Kostas Giapis <45879751+tsiflimagas@users.noreply.github.com>
2022-01-18 11:02:37 -08:00
John D Pell
317ff77810
lib/helpers: be extra careful with word splitting
...
Use curly braces when `$1` is unseparated from words in a string.
2022-01-18 11:02:37 -08:00
John D Pell
550f808884
lib/helpers: fix `_bash-it-describe()`
...
Use `_bash-it-component-item-is-enabled()`
Fix SC2295
2022-01-18 11:02:37 -08:00
John D Pell
4c473853e9
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.)
2022-01-18 11:02:37 -08:00
John D Pell
003b0ce802
lib/helpers: `shfmt`
...
My apologies to future `git blame` hunters ♥
2022-01-18 11:02:36 -08:00
John D Pell
6ed006a167
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()`
2022-01-18 11:02:21 -08:00
John D Pell
5eab3bd288
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 #1865 from NoahGorny...and clean it a bit...
2022-01-18 11:02:21 -08:00
John D Pell
9b51dc0b5f
lib/helpers: fix `_command_exists()`
...
The weird subshell is weird AF. Just do a normal `if`.
Ditto `_binary_exists()`, `_completion_exists()`, and `_is_function()`!
2022-01-18 11:02:10 -08:00
John D Pell
180fb93df8
lib/helpers: fix `all_groups()`
...
- 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
```
2022-01-18 11:02:10 -08:00
Noah Gorny
973a1f9b40
Merge pull request #1958 from gaelicWizard/plugin-proxy
...
plugin/proxy: lint
2022-01-18 19:42:32 +02:00
Noah Gorny
e116288b83
Merge pull request #2027 from gaelicWizard/lib/composure
...
Update `vendor/composure`
2022-01-18 19:40:41 +02:00
Noah Gorny
fd35094463
Merge pull request #2004 from gaelicWizard/finalize
...
Create lib finalize hook
2022-01-18 19:40:05 +02:00
Noah Gorny
8d5d9073ce
Merge pull request #1999 from gaelicWizard/utilities
...
lib/utilities: refactor `_bash-it-pluralize-component()` & other improvements
2022-01-18 19:39:45 +02:00
Noah Gorny
bdf9a2bca3
Merge pull request #1959 from gaelicWizard/log
...
Lib/log: linting and small improvements
2022-01-18 19:39:24 +02:00
John D Pell
77c5f8eda9
completion/dotnet: modernize
...
and `shfmt`
2022-01-12 22:39:49 -08:00
John D Pell
1a48bcc852
completion/dotnet: new completion
...
See: https://docs.microsoft.com/en-us/dotnet/core/tools/enable-tab-autocomplete#bash
2022-01-12 22:20:25 -08:00