Commit Graph

690 Commits (6662cadfe849cd819980c6f9c9b4baeab0525a3d)

Author SHA1 Message Date
terminalforlife 6662cadfe8 Undo my change to git command usage (the test)
This reverts commit 12e225afef.

Didn't realise when in '.git', it will return `0` but still show
`false`; git(1) is quite finicky, somtimes.
2021-02-17 23:01:07 +00:00
terminalforlife 0a420e7010 Use BASH instead of sed(1) for user.initials
I recommend looking into the BASH man page for its many awesome
variable expansion features, such as substring expansion and pattern
substitution.
2021-02-17 22:29:15 +00:00
terminalforlife 5f446f7f63 Use BASH instead of AWK for Python version
As the previous commit, but for Python's version.
2021-02-17 22:25:38 +00:00
terminalforlife 3aa8592350 Use BASH to get Ruby version, not AWK
No need for AWK there. By using just `read` (builtin), instead of
AWK, this commit winds up being a considerable optimization.

NOTE: The `_` is just commonly used to indicate junk; not used.
2021-02-17 22:19:08 +00:00
terminalforlife 387425e2b2 Use BASH instead of grep(1)
Much like my previous commit, grep(1) isn't needed here at all. BASH
can handle REGEX as well as glob pattern matching in a very similar
way.

In this commit, I've made use of a `while read` loop to achieve the
same thing as before, but much more efficiently. If it turns out that
the `rbenv` command usually returns a crap ton of data (10s of
thousands of lines, at _least_), then please ignore this commit.
2021-02-17 22:13:18 +00:00
terminalforlife 4fd66d4751 Use BASH instead of tr(1) & wc(1)
Most of the time, people use programs like tr(1) and wc(1) when they're
woefully unnecessary, serving only to make their programs inefficient
and bloated. BASH itself can deal with most of these tasks with
absolute ease. This is one such situation.
2021-02-17 22:04:36 +00:00
terminalforlife f4299f437c Remove redundant use of tail(1)
In:

```bash
if [[ -n "$(_git-status | tail -n1)" ]]; then
```

It seems pointless using tail(1); it does nothing here, unless I'm
missing something. Also, quotes aren't needed, because word-splitting
doesn't apply when variables are expanded in `[[`.

```bash
if [[ -n $(_git-status) ]]; then
```

The quoting thing is all over the code, but not a huge deal, as it's
just superficial. Variable word-splitting doesn't apply also during
the WORD in the case statement, and the VALUE in shell variable
assignment.

Personally, I would use `[`, since none of the `[[` features are being
used here, so it seems wasteful. In the BASH (4.4) source code,
assuming I'm looking at it correctly, `[[` is over 800 lines, yet `[`
(or `test`) is not even 200; that's part of the reason I prefer `[` and
use `[[` when it's actually needed. It's also not a huge deal though, -
as this is going to be incredibly fast either way, but thought I'd
mention it.
2021-02-17 21:56:38 +00:00
terminalforlife 12e225afef Tweak logic & slightly optimize git usage
This sort of test:

```sh
if CONDITION; then
	if CONDITION; then
		LIST
	fi
fi
```

The above is typically unnecessary, as the two conditions can be
combined to avoid pointless nesting.

Regarding the optimization: it's very minor, but there was an
unnecessary use of a subshell (command substitution) in testing this:

```
git rev-parse --is-inside-work-tree
```

This has been addressed, and instead of STDERR going to '/dev/null', -
now both STDOUT and STDERR do.

Although I'm pointing out this in just one instance, this sort of stuff
appears to be all over the code in this project, unfortunately.
2021-02-17 21:30:57 +00:00
tiago cb5047734b retval check 2021-01-27 22:55:44 +00:00
tiago 3a846a2d47 cleanup modern theme 2021-01-27 22:55:44 +00:00
Noah Gorny 9b04e11bfc
Merge branch 'master' into vendor 2021-01-27 16:43:34 +02:00
Noah Gorny 7b817f388d
Merge pull request #1790 from BarbUk/clean/theme_starting_by_b
Clean b* themes
2021-01-26 19:57:45 +02:00
tiago e80e29be6d Merge remote-tracking branch 'upstream/master' into fix-modern-theme 2021-01-24 14:09:48 +00:00
buhl 29855ed1e6 Adding preexec as a vendored library
Added a vendored lib loading routine in bash-it.sh
Added documentation on how to vendor libs in bash-it
Added and fixed plugins using preexec
Added tests for two plugins
Removed the old preexec lib
2021-01-23 18:31:18 +01:00
tiago e2be8bc2bc trailing and code style 2021-01-23 17:30:20 +00:00
tiago 54bf7f9a59 check if last command successful 2021-01-23 17:10:32 +00:00
tiago bb6354e205 removed trailing spaces 2021-01-23 14:42:58 +00:00
tiago c7f6e80ad0 fix modern theme, added virtualenv name 2021-01-22 17:07:16 +00:00
BarbUk f86d823dc3
Disable SC2207 to keep COMPREPLY simple 2021-01-22 18:41:16 +04:00
Noah Gorny d2ab59fef8 Disable keep-padding option in shfmt
Has some serious bugs and not really needed
Also fixed all files that need to be changed after this
2021-01-21 22:08:45 +02:00
BarbUk b92f53ece5
Update atomic theme with correct `compgen` syntax 2021-01-16 23:21:04 +01:00
BarbUk ef42c822e6
Update brainy theme with correct `compgen` syntax 2021-01-16 23:18:58 +01:00
BarbUk 814ff562e9
Fix rbenv version prompt 2021-01-16 09:25:12 +01:00
BarbUk 86fd073ee6
Clean brunton 2021-01-16 09:13:23 +01:00
BarbUk 662a5c4ac7
Clean brainy 2021-01-16 09:13:10 +01:00
BarbUk eadd2685df
Clean bobby 2021-01-16 09:12:59 +01:00
BarbUk 8691894175
Clean bira 2021-01-16 09:12:42 +01:00
BarbUk cfb9a22e70
Clean binaryanomaly 2021-01-16 09:12:20 +01:00
BarbUk fb0fa7f799
Clean bakke 2021-01-16 09:12:06 +01:00
BarbUk bd6dbd3edf
Merge branch 'master' into clean/theme_atomic_and_axin 2021-01-14 13:45:31 +01:00
Marcos Pereira 94d261b42d
Fix shellcheck warnings for themes/base.theme.bash 2021-01-12 00:55:15 -05:00
Marcos Pereira 5a761b7ae3
Run code fomatter for themes/base.theme.bash 2021-01-11 15:14:49 -05:00
BarbUk e574abbbba
Clean theme atomic 2021-01-11 11:42:04 +01:00
BarbUk 6495e3479e
Clean theme axin 2021-01-11 11:41:44 +01:00
David Farrell e932d8371f
Add hooks to check .sh and .bash headers - Fixes #1491 (#1765)
* Add hooks to check .sh and .bash headers
* Adds hooks/ to clean_files.txt
2021-01-09 18:02:26 +02:00
Noah Gorny f255d03057 shellcheck agnoster theme 2021-01-07 19:11:22 +02:00
Noah Gorny 60da498ed4 shfmt agnoster theme 2021-01-07 19:11:22 +02:00
BarbUk ae9da3b62b
Clean barbuk theme (#1766) 2021-01-07 19:05:00 +02:00
BarbUk 13e795c995
add command time duration plugin (#1683) 2020-12-27 18:48:17 +02:00
Russell b119540ce7
Add comment to install "t" and disable "todo.plugin" (#1742)
This commit is intended to help new uses of the
modern-t theme get it set up properly
and avoid the "todo.plugin" breaking it

Please see the following issues for details.
https://github.com/Bash-it/bash-it/issues/1693
https://github.com/Bash-it/bash-it/issues/1374

Co-authored-by: Russell Adams <russell.adams@avast.com>
2020-12-27 17:24:52 +02:00
Noah Gorny 28e4633e53
Merge pull request #1721 from NoahGorny/docs-remove-themes-readmes
docs: Remove themes readmes
2020-12-14 00:01:30 +02:00
Noah Gorny bced06994b Move theme documentation to be under docs/themes-list 2020-12-13 23:50:26 +02:00
Noah Gorny 1702e0217a docs: Remove themes readmes 2020-12-04 17:24:26 +02:00
Kan Li c13850faa2 Address some comments. 2020-11-28 19:07:10 -08:00
Kan Li 8ce9d8daa5 Add in_toolbox prompt to powerline themes
[Toolbox](https://github.com/containers/toolbox) is an containerized
development environment. This commit adds a promot to powerline when it
is running inside a toolbox.
2020-11-28 12:18:13 -08:00
Luis Felipe Sánchez 794f0e321e
Update atomic.theme.bash
fixed the space error after hiding the scm
2020-11-26 09:11:08 -05:00
David Farrell a858e75456
Add Dir Support to Clean_Files; Clean powerline theme 2020-11-03 16:14:02 -08:00
Noah Gorny 3f68817047 Clean 90210 theme 2020-10-31 12:33:12 +02:00
Noah Gorny 1f5d9b757f Fix newline and trailing space issues 2020-10-29 19:57:14 +02:00
Noah Gorny 507e4bec82 Convert files with spaces and tabs to only spaces 2020-10-29 19:57:14 +02:00