Commit Graph

3816 Commits (150f73ee50e70a0f9d101818d604a0a76c28a83f)

Author SHA1 Message Date
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
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
Noah Gorny 78da4ca760
Merge pull request #2089 from gaelicWizard/plugin/alias-completion
completion/aliases: typo
2022-02-15 22:09:44 +02:00
John D Pell c982a881a2 completion/aliases: typo 2022-02-14 16:00:15 -08:00
John D Pell 12a734cb49 aliases/general: use single quotes as much as possible 2022-02-14 15:40:56 -08:00
John D Pell 27bfc966ac aliases: add shellcheck headers 2022-02-14 15:40:56 -08:00
John D Pell 604e5c5040 alias/todo.txt-cli: `shellcheck` 2022-02-14 15:40:56 -08:00
John D Pell 665d9e96a8 alias/osx: `shellcheck` 2022-02-14 15:40:56 -08:00
John D Pell 8d30275b8a alias/msys2: `shellcheck` 2022-02-14 15:40:56 -08:00
John D Pell ea6cb6afec alias/laravel: `shellcheck` 2022-02-14 15:40:56 -08:00
John D Pell 826916be4f alias/homesick: `shellcheck`
Alsö, remove impossible alias. If someone wants it, they can write the function, but since aliases literally don't work this way it seems obvious that nobody has ever used it.
2022-02-14 15:40:56 -08:00
John D Pell 11aa32387e alias/general: `shellcheck` 2022-02-14 15:40:56 -08:00
John D Pell 5748aa20a7 alias/docker: `shellcheck` 2022-02-14 15:40:56 -08:00
John D Pell 7c2c2a5525 aliases: run `shfmt` on the whole folder
My apologies to future `git blame` hunters ♥
2022-02-14 15:40:56 -08:00
Ira Abramov 16bf32be65 Merge branch 'master' of https://github.com/Bash-it/bash-it into ira/fix-dirs
* 'master' of https://github.com/Bash-it/bash-it: (22 commits)
  main: variable name cleanup
  lib/history: new functions `_bash-it-history-auto-*()`
  plugin/history*search: no need to load after `plugin/history`
  plugin/history-eternal: Use `readonly` instead of `export`
  plugin/history: don't use `export`
  lib/preview: add full completion
  lib/helpers: add `preview` to `bash-it` spaghetti
  lib/preview: refactor into a function
  completion/system: correctly load version when not linked
  main: adopt `_bash-it-log-prefix-by-path()`
  main: Glob for *.bash properly when path contains spaces
  completion/aliases: rename init function
  test/battery: require matching battery identifier
  test/battery: add multiple-battery edge case
  plugin/battery: split `upower` to two variables
  completion/alias: add stub file
  completion/alias: fix tests
  completion/alias: rename
  completion/alias: `shfmt` && `shellcheck`
  completion/alias: eliminate use of `eval`
  ...
2022-02-14 10:31:04 +02:00
Noah Gorny 0619c19f65
Merge pull request #2074 from NariyasuHeseri/master
plugin/battery: bug fix
2022-02-14 08:22:33 +02:00
John D Pell 363827a3b5 theme/pure: cleanup
Use `\$` to let _Bash_ choose the mark, move `PS1=` outside the `case` statement.

#TODO: last command status?
2022-02-13 16:18:00 -08:00
Noah Gorny 561e282585
Merge pull request #2044 from gaelicWizard/completion/alias
completion/aliases: eliminate use of `eval`
2022-02-13 23:59:35 +02:00
Noah Gorny 89c9504a5e
Merge pull request #2017 from gaelicWizard/lib/preview
lib/preview: functionalize
2022-02-13 23:59:06 +02:00
Noah Gorny ee135d28da
Merge pull request #2069 from gaelicWizard/completion/system
completion/system: correctly load version when not linked
2022-02-13 23:57:35 +02:00
Noah Gorny 253004a599
Merge pull request #1940 from gaelicWizard/history
Feature: automatic history management
2022-02-13 23:57:14 +02:00
Noah Gorny 23f9b7416a
Merge pull request #1902 from gaelicWizard/glob
Glob for *.bash properly when path contains spaces
2022-02-13 23:53:57 +02:00
Ira Abramov 98889b208c Tilde expanstion won't work once it is a quoted string, expanding in advance. 2022-02-11 09:56:10 +02:00
John D Pell 146107926e main: variable name cleanup 2022-02-10 10:46:33 -08:00
John D Pell 5d5858058e lib/history: new functions `_bash-it-history-auto-*()`
Two new functions `_bash-it-history-auto-save()` and `_bash-it-history-auto-load()`, which append new history to disk and load new history from disk, respectively.

See bash-it/bash-it#1595 for discussion.
2022-02-08 16:59:29 -08:00
John D Pell f6119567e8 plugin/history*search: no need to load after `plugin/history`
There's no need for these plugins to load after `plugin/history`. None of the history plugins depend upon each other loading before, after, or at all.
2022-02-08 16:59:29 -08:00
John D Pell 267a721ac6 plugin/history-eternal: Use `readonly` instead of `export`
...and hide errors relating to setting already-readonly variables.

`plugin/history-eternal` does not need to force loading after `plugin/history` because both plugins will play nicely with read-only variables, and since we're overwritting and marking read-only then the intended result survives no matter which loads first.

plugin/history-eternal: require Bash v4.3+

Unlimited history is only possible in _Bash_ version 4.3 and up
2022-02-08 16:59:29 -08:00
John D Pell 8052911861 plugin/history: don't use `export`
...so the plugin is friendly to variables already marked read-only.
2022-02-08 16:59:29 -08:00
Gurkirat Singh 70dbda053b
Remove redundant aliases for clear screen 2022-02-08 14:49:43 +05:30
John D Pell 00e3955dd3 lib/preview: add full completion 2022-02-07 15:27:03 -08:00
John D Pell a9a40a3cad lib/helpers: add `preview` to `bash-it` spaghetti 2022-02-07 15:27:03 -08:00
John D Pell d6555f369a lib/preview: refactor into a function
This allows future use like `bash-it preview`. Alsö, allows to use `$BASH_PREVIEW` to specify a particular theme to preview instead of just doing all of them.
2022-02-07 15:27:03 -08:00
John D Pell 1480cdfa34 completion/system: correctly load version when not linked
- Load the correct version of `bash-completion` even when not "linked".
2022-02-07 15:15:46 -08:00