Commit Graph

752 Commits (cb9b999f06fe4e6d14caddaa8315d6e19ddc907d)

Author SHA1 Message Date
John D Pell 2cea663a4a lib/theme: handle undefined parameter 2022-02-18 03:06:17 -08: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
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 5f19de8d51 plugin/colors: rename `theme/colors` 2022-01-28 13:09:00 -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
Noah Gorny 44a1b55db7
Merge pull request #2037 from gaelicWizard/theme/brunton
theme/brunton: `shellcheck`
2022-01-25 18:18:54 +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
John D Pell b1e922ea38 theme/norbu: `shellcheck` && `shfmt`
# Conflicts:
#	clean_files.txt
2022-01-25 00:01:27 -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
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 27ebc585be theme/brunton: SC2154
Handle all unbound parameters, even colors!
2022-01-12 13:38:10 -08:00
John D Pell 8e8fe69db4 theme/pete: `shellcheck` && `shfmt` 2022-01-12 13:29:40 -08:00
John D Pell bdaf29f84c Create lib finalize hook
Create an array `_bash_it_library_finalize_hook` and loop at the end of the main `bash_it.sh` to run each element in the array.

The purpose here is to run some command after everything else has been loaded. For example, the appearance lib checks for executables for SCM commands, but `$PATH` may be altered after appearance has loaded and therefore some available commands may never be discovered. Therefore, create `_bash_it_appearance_scm_init()` and add it to the hook. It will re-check at end of `bash_it.sh` just before prompt is first displayed.
2022-01-09 00:46:51 -08:00
John D Pell fcbe4e90b7 theme/easy: SC2154
Handle all unbound parameters, even colors!
2022-01-08 08:45:52 -08:00
John D Pell c7c447a54b theme/candy: SC2154
Handle all unbound parameters, even colors!
2022-01-08 08:45:52 -08:00
John D Pell 262e55eda2 theme/bobby: SC2154
Handle all unbound parameters, even colors!
2022-01-08 08:45:52 -08:00
John D Pell 6db5f38f6e theme/atomic: lint/cleanup
Use `[[` instead of `[`, set some local variables, still more to clean
2022-01-08 08:45:35 -08:00
Noah Gorny 6fc47a7671
Merge pull request #2021 from NariyasuHeseri/master
theme/powerline: fix error `scm: parameter not defined`
2022-01-07 08:51:00 +02:00
Nariyasu Heseri 9d8002226d theme/powerline: fix error `scm: parameter not defined` 2022-01-06 18:44:18 +09:00
John D Pell f2dcb2aff6 theme/essential: s/echo/printf/g 2022-01-03 20:45:39 -08:00
John D Pell 3695862b43 theme/essential: cleanup
Lose a couple of useless `echo`s/subshells.

Alsö, lose the incorrect VIM modeline from the bottom. Our formatting standard is specified in `$BASH_IT/.EditorConfig`.
2022-01-03 20:45:39 -08:00
John D Pell d1b7166358 theme/essential: `shfmt` 2022-01-03 20:45:39 -08:00
John D Pell 9f79848eed theme/essential: SC2154
Handle all unbound parameters, even colors!
2022-01-03 20:45:39 -08:00
John D Pell 2991aa66ca theme/powerline: SC2154, SC2248 2021-12-27 12:20:46 -08:00
John D Pell c323357067 theme/purity: SC2154
Handle all unbound parameters, even colors!
2021-12-27 12:20:46 -08:00
John D Pell e560e88814 theme/pure: SC2154
Handle all unbound parameters, even colors!
2021-12-27 12:20:46 -08:00
John D Pell 895102edeb theme/codeword: SC2154
Handle all unbound parameters, even colors!
2021-12-27 12:20:46 -08:00
John D Pell 4bc83d7940 theme/bira: SC2154
Handle all unbound parameters, even colors!
2021-12-27 12:20:46 -08:00
John D Pell 2c14a18483 theme/bakke: fix SC2154
Handle all unbound parameters, even colors!
2021-12-27 12:20:46 -08:00
John D Pell c769234350 theme/90210: fix SC2154
Handle all unbound parameters, even colors!
2021-12-27 12:20:46 -08:00
Mike James 1273504267 themes: fix doubletime_multiline scm_prompt
Replace doubletime_scm_prompt with scm_prompt.
2021-11-26 13:21:07 -08:00
Noah Gorny 2d1bd82575
Merge pull request #1975 from krapshsa/krapshsa-patch-1
Fix save-and-reload-history command not found
2021-10-18 22:22:21 +03:00
Noah Gorny 5feebcc9d9
Merge pull request #1974 from zou000/patch-1
Fix home dir substitution
2021-10-18 21:59:59 +03:00
krapshsa b0e8729b0f
Fix save-and-reload-history command not found 2021-10-19 00:58:01 +08: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 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
Ira Abramov c3d333ddc4 fix based on remarks on PR 2021-10-10 15:25:45 +03:00
John D Pell a2e32f37c5 theme/dulcie: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell eabdf41b83 lib/theme: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell a375e7131e Remove executable bit 2021-09-18 22:26:27 -07:00
John D Pell 5fc418e479 Use `${PWD}` instead of `$(pwd)`
Don't subshell when there's a shell parameter for it.
2021-09-18 13:15:13 -07:00
John D Pell 1c3cbf7ca6
Delete `.shellcheckrc` (#1947)
* CI: disable Ubuntu 16.04 as it's EOL

https://github.blog/changelog/2021-04-29-github-actions-ubuntu-16-04-lts-virtual-environment-will-be-removed-on-september-20-2021/

* main: lint false positive

* install: lint

* plugins/cmd-returned-notify: don't `export`

* plugins/xterm: lint

* plugins/git: lint

* plugins/goenv: lint

* plugins/alias-completion: lint false positives

* plugins/alias-completion: fix SC2155, SC2154

Declare `locals` at the top of the function

* completion: lint completions using `bash_completion` functions

Match the style of the existing code

* completion/knife: lint false positives

* completion/knife: lint

* completion/sdkman: lint

* completion/composer: lint

* Move `.shellcheckrc` under `themes/`

* lib/theme: fix SC2155, SC2154, SC2034

* lib/colors: don't warn on unused variables

We assign a large number of variables here and they may or may not be used anywhere else, so disable SC2034 for this file (only).

Alsö disable SC2005 as the functions in this file were written before `printf` was invented and have to do some fancy metascripting to get escape sequences interpreted reliably. I’m not smart enough to fix this to use `printf`, so leave it for now.

* themes/agnoster: lint

* themes: disable SC2154 for colors

Each one of these themes will need it’s own fix for SC2154, possibly upstream.

Due to the way themes are, it's entirely normal to have a *lot* of false positives for SC2034. So much so, that I have to admit that it is probably just not worth linting for SC2034 despite my dislike of blanket ignore rules.

* themes: disable SC2154, fix SC2155

Each one of these themes will need it’s own fix for SC2154, possibly upstream.

Due to the way themes are, it's entirely normal to have a *lot* of false positives for SC2034. So much so, that I have to admit that it is probably just not worth linting for SC2034 despite my dislike of blanket ignore rules.

* Delete `.shellcheckrc`

* remove executable bit
2021-09-18 12:50:59 +03:00
Noah Gorny b48f3fd7d3
Merge pull request #1909 from gaelicWizard/SVN
themes/base: don't invoke svn if possible
2021-09-18 12:39:48 +03:00
John D Pell 9d656747a9 themes: remove executable bit 2021-09-11 21:25:14 -07:00
John D Pell ffe15ebfe0 themes: use `_save-and-reload-history()`
First pass to use _Bash It_'s automatic history management.
2021-09-11 21:25:14 -07:00
John D Pell 476fcb4325 lib/theme: new `_bash_it_appearance_scm_init()`
Wrap init code in a function and call the function immediately. Several plugins do this, and it allows us to more easily implement a hooks-based system in the future.

Alsö, avoid external binary `which`. Use built-in `type -P` instead. Uppercase `-P` forces a path search to avoid hashed matches and functions/aliases and whatnot.
2021-09-11 10:22:17 -07:00