Commit Graph

3625 Commits (5fab574bfd4f750371bcec602e4026ede00bd89c)

Author SHA1 Message Date
John D Pell b8ee63c67d lib/utilities: quote SC2295
Doesn't show up on my shellcheck 0.7.2, but does for NoahGorny!
2021-10-18 09:14:32 -04:00
John D Pell b986c39040 lib/utilities: XDG_CACHE_HOME
Use $XDG_CACHE_HOME environment constant instead of placing a tmp/cache folder inside the bash-it data repo. If not defined, fall back to current behavior.

This resolves Bash-It/Bash-It#1904.
2021-10-18 09:14:32 -04:00
Noah Gorny 7987e4bfcd
Merge pull request #1883 from seefood/ira/autosave-history-plml
Add history flushes on each command to the powerline themes
2021-10-17 19:51:56 +03:00
zou000 7911f770cf
use `\w` 2021-10-16 22:29:25 -07:00
zou000 bb3a51f742
Update powerline.base.bash 2021-10-16 20:24:07 -07:00
zou000 413d7a1326
Fix home dir substitution
See the discussions in 953e422bed (commitcomment-58148656) . Tested with bash 5.1 and  bash 3.2
2021-10-16 19:15:00 -07:00
John D Pell 7cd02781f8 lib/utilities: `_bash-it-component-help()`
No need to `rm` when we overwrite the file the line after next. Alsö, use `>|` in case the user sets `noclobber`; we do expressly intend to overwrite the file in this case.
2021-10-13 21:13:45 -07:00
John D Pell f7cc442af4 lib/utilities: simplify `_bash-it-array-dedup()`
alsö fix usage example of `_bash-it-array-contains-element()`
2021-10-13 09:28:21 -07:00
Noah Gorny 48c17e95c3
Merge pull request #1968 from gaelicWizard/oops
theme/powerline: fix an oops in the last patch
2021-10-12 23:26:17 +03:00
John D Pell 953e422bed theme/powerline: fix an oops in the last patch
The tilde should not have been escaped, and in fact I did not have it escaped in my main branch, but the PR I submitted did have it escaped and...now it shows up in the prompt line for all the PowerLine themes... oops.
2021-10-12 11:08:37 -07:00
Ira Abramov d6239cf190 Merge branch 'master' of https://github.com/bash-it/bash-it into ira/autosave-history-plml
* 'master' of https://github.com/bash-it/bash-it: (114 commits)
  ci: Bump go to 1.17 from 1.14
  skip go tests when go is not available
  plugins: Add ble.sh plugin
  clean up pyenv plugin
  Lint: prepare `lib/utilities` for `shellcheck` (#1933)
  plugin/base: improvements (#1930)
  plugins/percol: `bind`
  completion/git: `shfmt` && `shellcheck`
  completion/git: expand search range
  plugin/percol: `shellcheck` & `shfmt`
  plugins/percol: use `_command_exists`
  completion/pip: simplify code flow
  plugin/less-pretty-cat: remove `|| cat`
  completion/wpscan: simplify code flow (whitespace)
  plugins/less-pretty-cat: simplify code flow
  plugins/less-pretty-cat: use `_command_exists`
  lib/helpers: cite `_bash-it-find-in-ancestor()`
  gradle: adopt `_bash_it_find_in_ancestor()`
  lib/helpers: new function `_bash-it-find-in-ancestor()`
  completion/laravel: simplify code flow
  ...
2021-10-11 08:32:15 +03:00
Noah Gorny 49698e269a
Merge pull request #1971 from NoahGorny/ci-update-go-version
ci: Bump go to 1.17 from 1.14
2021-10-10 23:58:08 +03:00
Noah Gorny adab880f89 ci: Bump go to 1.17 from 1.14 2021-10-10 23:50:39 +03:00
Ira Abramov c3d333ddc4 fix based on remarks on PR 2021-10-10 15:25:45 +03:00
Noah Gorny cf08fcaff2
Merge pull request #1965 from gaelicWizard/completion-git
completion/git: improvements and linting
2021-10-07 00:10:47 +03:00
Noah Gorny c3382c7b50
Merge pull request #1884 from NoahGorny/add-blesh-plugin
plugins: Add ble.sh plugin
2021-10-06 22:49:15 +03:00
cornfeedhobo 07384bcf7c
Merge pull request #1967 from cornfeedhobo/goenv-go-tests
skip go tests when go is not available
2021-09-30 07:34:05 -05:00
cornfeedhobo b7feb14404
skip go tests when go is not available 2021-09-29 18:16:52 -05:00
Noah Gorny cd38f32d95 test: Fix completion tests and add profile completion ones 2021-09-29 00:30:24 +03:00
Noah Gorny 4c4b138671 tests: Add more bash-it profile tests 2021-09-29 00:30:24 +03:00
Noah Gorny 7fc003b7d6 completion: Add completion for bash-it profile rm/list 2021-09-29 00:30:24 +03:00
Noah Gorny e1017513d0 helpers: Disallow removing the default profile with bash-it profile rm 2021-09-29 00:30:24 +03:00
Noah Gorny 1ae407150c helpers: Improve bash-it profile messages 2021-09-29 00:30:24 +03:00
Noah Gorny 337e188d25 helpers: Add bash-it profile rm 2021-09-29 00:30:24 +03:00
Noah Gorny 81b17f795b helpers: Add bash-it profile list 2021-09-29 00:30:24 +03:00
Noah Gorny 6a923760d8 helpers: Add help message for bash-it profile 2021-09-29 00:30:24 +03:00
Noah Gorny c710fc783a gitignore: Ignore new profiles 2021-09-29 00:30:24 +03:00
Noah Gorny b2ee5f96a5 test: helpers: Add profile command tests 2021-09-29 00:30:24 +03:00
Noah Gorny d4ec41bef7 helpers: Add useful log in case of empty config 2021-09-29 00:30:24 +03:00
Noah Gorny df560ca04a docs: Add profile command docs 2021-09-29 00:30:24 +03:00
Noah Gorny f78139fc05 install: Use new profile load command 2021-09-29 00:30:24 +03:00
Noah Gorny 2e3fe0a1ea install: Load log file 2021-09-29 00:30:24 +03:00
Noah Gorny cea95d72b3 lib: helpers: Rename _bash-it-process-component to _bash-it-determine-component-status-from-path 2021-09-29 00:30:23 +03:00
Noah Gorny 7f60b73a2a helpers: Add new bash-it profile subcommand 2021-09-29 00:30:23 +03:00
Noah Gorny 956ca517f4 profiles: Add new default profile 2021-09-29 00:30:23 +03:00
Noah Gorny eaa2f829bd completion: Add bash-it profile subcommand 2021-09-29 00:30:23 +03:00
Noah Gorny 41cba9d7e4 helpers: Add enable-plugin and enable-alias aliases 2021-09-29 00:30:23 +03:00
Noah Gorny ffeb770593 helpers: Print type when using disable all 2021-09-29 00:30:23 +03:00
Noah Gorny 6e03a726a6 helpers: Split some processing code out of _bash-it-describe 2021-09-29 00:30:23 +03:00
Noah Gorny 7fb7bb9cb8
Merge pull request #1952 from gaelicWizard/uncle
lib/helpers: new function `_bash-it-find-in-ancestor()`
2021-09-28 16:51:30 +03:00
Noah Gorny 008c2b30ac
Merge pull request #1885 from cornfeedhobo/pyenv-path
clean up pyenv plugin
2021-09-28 16:49:21 +03:00
Noah Gorny c360f0c7c5 plugins: Add ble.sh plugin 2021-09-28 16:48:16 +03:00
cornfeedhobo ec075a404a
clean up pyenv plugin
This commit cleans up the pyenv plugin to follow the newer conventions of the
other *env plugins, as well as addresses the changes made to pyenv for PATH
munging.
2021-09-28 07:44:40 -05:00
John D Pell 3eed0f033f
Lint: prepare `lib/utilities` for `shellcheck` (#1933)
* lib/utilities: shellcheck

SC2059

* lib/utilities: fix `_bash-it-get-component-type-from-path()`

Account for plugins with names that contain periods.

* lib/utilities: fix `_bash-it-array-dedup()`

Use fewer subprocesses and newline-delimited not space-delimited.

* lib/utilities: fix `_bash-it-component-list()`

Use fewer subprocesses and return newline-delimited, not space-delimited.

* lib/utilities: fix `_bash-it-component-list-matching()`

Use `sort -u` instead of `sort | uniq`

* lib/utilities: fix `_bash-it-component-list-enabled()`

Use fewer subprocesses, return newline-delimited instead of space-delimited, and use `sort -u` instead of `uniq | sort`

* lib/utilities: fix `_bash-it-component-list-disabled()`

Use fewer subprocesses, return newline-delimited instead of space-delimited, and use `sort -u` instead of `uniq | sort`

* lib/utilities: fix `_bash-it-grep()`

1. Executing `'/usr/bin/grep'` does *not* return the path to grep...
2. use `type -p` instead of external binary `which`.
3. Simplify parameter definition.
4. Why was there a space after `%s`?

* lib/utilities: use `_bash-it-grep`

Alsö, lose a spurious `cat`

* lib/utilities: lint `_bash-it-component-help`

* lib/utilities: lint `_bash-it-component-cache-file()`

* lib/utilities: `shfmt`

My apologies to future `git blame` hunters ♥

* lib/helpers: fix `_bash-it-get-component-name-from-path()`

Use `${BASH_IT_LOAD_PRIORITY_SEPARATOR}`
2021-09-28 15:24:18 +03:00
Noah Gorny 8a1dc96bc0
Merge pull request #1964 from gaelicWizard/completion-pip
completion/pip: simplify control flow
2021-09-28 15:14:58 +03:00
John D Pell c2c76a380a
plugin/base: improvements (#1930)
* plugins/base: code style improvements

Quote variables, use $@ and $array[@] instead of $*, typeset some integers, remove unneccesasary binary invocation, use shell features when possible, remove `eval`, &c.

* plugins/base: conditional function definitions

Instead of functions failing when required tools aren't installed, just don't define the function.
Alsö, don't redefine del() if it already exists.

* plugins/base: rewrite `usage()`

Reimplement disk usage function using Bash syntax and simpler layout, without having to invoke an external binary.

* plugins/base: revamp `quiet()`

New implementation that is even quieter.

* plugins/base: `myip()`

* plugins/base: `pickfrom()`

* plugins/base: `passgen()`

Fix `passgen()` to not need `tr`, remove one subshell, and eliminate a useless `echo`.

* plugins/base: `mkcd()`

* plugins/base: `mkiso()`

* plugins/base: remove `banish-cookies()`

Adobe Flash is gone with the wind. Alsö, this would be something someone would do *once* and shouldn't be a function...

* plugins/base: `lsgrep` is SC2010

The `lsgrep()` function is *itself* explicitly forbidden by `shellcheck` rule SC2010.

Alsö, s/`$*`/`$@`

* plugins/base: `mkiso()`

Expressly handle unbound parameters.

* plugins/base: remove `command_exists`

* plugin/base: lint SC2154 && SC2144

Newly undisabled `shellcheck` rules

* plugin/base: import libs for tests

* plugin/base: `shfmt`

Apply `shfmt` using current project settings. My apologies to future `git blame` hunters. ♥
2021-09-28 15:13:27 +03:00
Noah Gorny 127cbbd4e3
Merge pull request #1957 from gaelicWizard/plugin-less-pretty-cat
plugin/less-pretty-cat improvements
2021-09-28 15:09:28 +03:00
Noah Gorny 05aac8ef39
Merge pull request #1956 from gaelicWizard/plugin-percol
plugin/percol `shellcheck`
2021-09-28 15:06:33 +03:00
Noah Gorny 002a23c758
Merge pull request #1961 from gaelicWizard/completion-wpscan
completion/wpscan: simplify code flow (whitespace)
2021-09-28 15:02:25 +03:00
Noah Gorny 37577550e1
Merge pull request #1963 from gaelicWizard/completion-laravel
completion/laravel: simplify code flow
2021-09-28 14:34:51 +03:00