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
cornfeedhobo
61f727fb96
refactor all history modifications into discrete plugins
2021-01-15 11:53:28 -06:00
Noah Gorny
6914a2345a
version: Fix url in case it is ssh based one
2020-12-21 00:30:56 +02:00
Noah Gorny
e023d6f851
Improve bash-it version output
...
As we now have "stable" releases and "dev" type of versions, `version` command should
provide usefull output on that
2020-10-27 20:01:50 +02:00
Noah Gorny
825fc88a8f
Rename _bash-it_update to _bash-it-update
2020-10-25 15:24:19 +02:00
Noah Gorny
8a36f21ca1
Add _binary_exists and use in github-cli completion
...
gh was also used as an git alias, and caused _command_exists to not fail as expected
2020-10-21 00:14:11 +03:00
Noah Gorny
c387517122
Merge pull request #1626 from NoahGorny/update-to-stable-or-unstable
...
bash-it update to stable or dev
2020-10-16 14:16:06 +03:00
Noah Gorny
a1adfaaa3e
lib: helpers: Handle stable revert update
2020-10-13 15:41:28 +03:00
Noah Gorny
6bed26eccb
lib: helpers: Rename Upgrading -> Updating
2020-10-13 15:30:19 +03:00
Noah Gorny
0a9b43e86d
lib: Fetch from remote before calculating latest tag in bash-it update
2020-10-13 15:30:19 +03:00
Noah Gorny
4ca6dd9a36
helpers: Add --slient option to bash-it update
2020-10-13 14:42:02 +03:00
Noah Gorny
9b208e7d5c
lib: Update no-op message in case of stable update
2020-10-13 14:42:02 +03:00
Noah Gorny
8e6876719b
lib: Add BASH_IT_DEVELOPMENT_BRANCH variable
2020-10-13 14:42:02 +03:00
Noah Gorny
ecf65569ce
lib: Update to stable now correctly fails if no tags are present
2020-10-13 14:42:02 +03:00
Noah Gorny
96295e92a5
lib: Improve bash-it update so it can update to latest tag
2020-10-13 14:42:02 +03:00
Noah Gorny
f4279e63c1
Add bash-it restart command
...
Also add completion and completion tests
2020-10-12 15:29:36 +03:00
Noah Gorny
24c05995e7
helpers: Auto reload now only reloads and not reset the shell
2020-10-10 04:02:30 +03:00
cornfeedhobo
97bb1fc7ba
allow the caller to pass a custom log message when the command is not found
2020-08-03 14:20:04 -05:00
Noah Gorny
72dbfd2480
lib: log: Insert log level before message prefix
...
Also fix tests accordinly
2020-07-02 21:11:40 +03:00
Noah Gorny
e6ebcda608
log: Fix logging to comply with the tests
2020-07-02 21:11:40 +03:00
Noah Gorny
8d9f81fce0
lib: Add get-component-name/type-from-path
2020-07-02 20:13:57 +03:00
Noah Gorny
8a3cf76307
lib: Move _has_colors to log module
2020-07-02 20:13:42 +03:00
Noah Gorny
5daecc9381
lib: Log in case _command_exists fails
2020-06-30 20:58:09 +03:00
Noah Gorny
9a23725ce0
log: Add BASH_IT_LOG_PREFIX option
...
Also add a new test to check it
2020-06-25 00:16:16 +03:00
Noah Gorny
3e7a95660f
lib: Add _has_colors function and use it in log output
2020-06-23 15:42:22 +03:00
Noah Gorny
86824a93ed
helpers: Add bash-it doctor command
2020-06-23 15:12:43 +03:00
Noah Gorny
802c45b401
lib: Add log module
2020-06-23 15:12:43 +03:00
Noah Gorny
3eac73f613
plugins: Rename gitstatusd plugin to gitstatus
2020-06-22 14:57:05 +03:00
Noah Gorny
bda85c3679
lib: Add on-disable-callback for plugins to use
2020-06-22 14:56:13 +03:00
Eduardo Bellido Bellido
1bf9bbde0d
Use new line character instead semicolon in the preexec hook
2020-03-14 22:56:30 +01:00
cornfeedhobo
d4c2f8b73f
nit pick cleanup
2020-03-08 23:53:27 -05:00
John McBride
036c26dbed
Update jump plugin
...
- remove z plugin
- remove fasd plugin
- update test that referenced fsad
Signed-off-by: John McBride <jpmmcbride@gmail.com>
2020-02-03 11:43:24 -07:00
Nils Winkler
f29a195f49
Make sed replacements work for both BSD and GNU sed
...
Fixes #1411
2019-07-31 08:50:33 +02:00
Eivind Uggedal
4ea5fe57c9
utilities.bash: fix tiny typo
2019-04-14 22:31:38 +02:00
Nils Winkler
04937aa2ec
Merge pull request #1312 from kylewelsby/bugfix/1203-bug-enable-alias-all
...
Fixes #1203 convert alias to aliases
2019-01-21 08:36:38 +01:00
Kyle Welsby
ca58587217
Fixes #1203 convert alias to aliases
...
A ungraceful patch but fixes this one case where the command is singular `alias` while the file are plural with `aliases.
2019-01-16 18:16:08 +00:00
Kyle Welsby
fedb72b34f
Fixes exit 1 issue when tmp cache doesn't exist
...
Found if this `${cache}` file doesn't exist, the single line conditional command would return false causing a `exit 1`.
This little change makes the conditional verbose and not cause a false return failing the function.
2019-01-16 17:36:57 +00:00
Nils Winkler
792593c995
Merge pull request #1273 from kigster/kig/search/improved
...
Speed up bash-it Search & support exact matches
2019-01-14 09:05:02 +01:00
Claudia
0fe631ea7c
Make `bash-it reload` preserve working directory
...
In e5b6869 (part of #1283 ), a regression was introduced, which caused
`bash-it reload` to return with the working directory set to
`.bash_it` and the original working directory discarded.
The root cause is the function wrapper of `bash-it reload`, which has
always relied on the working directory not to change during execution
of the wrapped code. This assumption no longer holds with the changes
introduced in #1283 .
This commit fixes the regression by using `pushd`/`popd` in `bash-it
reload`.
2019-01-02 17:45:43 +01:00
Travis Swicegood
1dadfc92ba
Merge pull request #1283 from Bash-it/bugfix/bash_completion_debian
...
Bugfix - issue with sourced files (noted by @caguettaz)
2018-12-05 22:07:07 -06:00
Travis Swicegood
0793eb41a7
Ignore SC2139 – it's ok that these are expanded when evaluated
2018-12-05 21:00:41 -06:00
Travis Swicegood
61380e686f
Remove unused function
2018-12-05 21:00:09 -06:00
Travis Swicegood
e5b68695c0
Attempt to simplify by not using aliases
2018-12-04 22:02:10 -06:00
caguettaz
13b6f3d870
[cleanup] Cleaned escaped newlines for alias reload
2018-12-04 16:31:03 +01:00
caguettaz
a1bbecc4a5
[bugfix] Fixed reload aliases
2018-12-04 15:58:21 +01:00
caguettaz
e198d8dc3d
[bugfix] Fixed config family names for reload aliases
2018-12-04 14:58:13 +01:00
caguettaz
f06439edc3
[cleanup] Harmonized variable names, added support for global config files
2018-12-04 14:30:11 +01:00
Travis Swicegood
babb1e6675
Adjust to only show merges into master
...
Adding `--first-parent` ensures that only commits from the master branch
are used when showing the history. I've verified this change directly
by comparing the `rev-list` output for `703105c..97df5c45`:
```console
$ git rev-list --merges 703105c...97df5c4
97df5c4540
b5976ada25
$ git rev-list --merges --first-parent 703105c...97df5c4
97df5c4540
```
Note: I've created this branch from 703105c so that I can merge `master`
into it and test `bash-it update` once merged.
2018-12-03 21:17:49 -06:00
Travis Swicegood
185c2879d5
Update to show the subject if the body is empty
2018-12-02 10:53:56 -06:00
Travis Swicegood
8e7a566d96
Show update prompt when running bash-it update
...
This utilizes the body of the merged PR requests to show the commits
that are included in this update. It gives the user a chance to
decline the upgrades by pressing n or N.
2018-12-02 10:47:11 -06:00
Konstantin Gredeskoul
09c2be9d6b
Refactor (extract utilities + add tests) & more…
...
* Extracting common utilities into utilities.bash
* Adding new tests for utilities
* Relocating the cache file to be under $BASH_IT
* Removing cache cleanup deferral code for now
* Wiping the cache in local_setup in tests.
2018-11-23 16:40:35 -08:00
Christophe Aguettaz
2f3d4bd130
[cleanup] Added missing global variable cleanup
2018-11-23 22:59:19 +01:00
Christophe Aguettaz
1ba023c97a
[bugfix][wip] Fixed issue with Debian's bash-completion
2018-11-23 22:25:14 +01:00
Konstantin Gredeskoul
baae0305b6
Speed up bash-it Search & support exact matches
...
This commit improves Bash-It search functionality in a couple of ways:
* bash-it search (with no arguments) will print detailed help.
* bash-it search now accepts terms prefixed with '@' sign, indicating an exact match.
* bash-it search now performs smarter caching of the component listings/status
New search syntax is as follows:
bash-it search [-|@]term1 [-|@]term2 [ --enable | --disable | --help ]
2018-11-19 11:55:36 -08:00
Eduardo Bellido Bellido
4df44b1fa9
Bash-it don't returns to the previous path after update
2018-11-12 22:59:14 +01:00
Nils Winkler
f6e2fdd2cf
Fixed reload command in the update function
2018-07-19 09:00:43 +02:00
Nils Winkler
4192d07f4f
Fixed indentation and a broken character
2018-07-19 09:00:42 +02:00
Brett A. Rogers
9571c11ad0
Return to original directory after reload
2018-05-16 14:58:59 -04:00
Piotr Rogoża
48e6888a38
Removed reload keyword from composure_keywords(), it is not needed
2018-04-21 19:15:50 +02:00
Piotr Rogoża
89d1661d23
Replaced reload section with proper function.
...
Added completion for reload.
Fixed order in completion
Added unit tests for completion
The variable BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE has to be unset.
2018-04-18 21:51:20 +02:00
Piotr Rogoża
b1dbf2f7e0
Added additional parameter for bash-it: reload
...
Added creating an alias if command does not exist
2018-04-18 21:51:20 +02:00
Mike Fiedler
7b17c17b09
Add a comparison URL to version
...
In order to make a swift comparison between the currently-installed
version vs the latest commits on `master`, emit a clickable URL that
will show the user the exact changes.
Signed-off-by: Mike Fiedler <miketheman@gmail.com>
2018-03-05 09:33:09 -05:00
Mike Fiedler
b0bceb963e
Replace subshell for git hash, add remote info
...
Signed-off-by: Mike Fiedler <miketheman@gmail.com>
2017-10-01 16:20:28 -04:00
Mike Fiedler
8015bba27f
Exit directory upon completion, update tests
...
Signed-off-by: Mike Fiedler <miketheman@gmail.com>
2017-09-30 20:06:42 -04:00
Mike Fiedler
71bda32dc0
Add version to commands
...
Add a helper to show the current git SHA of the installed git repo.
Signed-off-by: Mike Fiedler <miketheman@gmail.com>
2017-09-29 05:39:36 -04:00
Jean Jordaan
ca6a1ae2db
Use 'mktemp -t', leave tempfile cleanup to the OS
2017-09-28 21:54:58 +07:00
Nils Winkler
145ec5dfaa
Copied command_exists function to the helpers lib so that there is no hidden dependency on the base plugin
...
The original command_exists function will stay in the base plugin, but will no longer be used by other plugins or themes.
2017-09-17 21:05:59 +02:00
Nils Winkler
fd637a3dc6
Loading components from global enabled directory
2017-09-17 21:05:59 +02:00
Nils Winkler
5210707da8
Test cases for loading from global directory
2017-09-17 21:05:59 +02:00
Nils Winkler
f57bd1e131
Fixed issues with migrating components with the same name
...
dirs.plugin.bash was recognized while looking for dirs.completion.bash in the global enabled directory.
2017-09-17 21:05:59 +02:00
Nils Winkler
aa9a63a10e
Added message after migrating about possible fixes.
...
See #985 for background.
2017-09-17 21:05:59 +02:00
Nils Winkler
0791895236
Fixed some more shellcheck complaints
2017-09-17 21:05:58 +02:00
Nils Winkler
475b0778dd
Fixed a couple of shellcheck complaints
2017-09-17 21:05:58 +02:00
Nils Winkler
88ef16ccc7
Fixed migration order on macOS
2017-09-17 21:05:58 +02:00
Nils Winkler
6e34d4f837
Simplified disable all
2017-09-17 21:05:58 +02:00
Nils Winkler
1810eddaf3
Using compgen instead of globw
2017-09-17 21:05:58 +02:00
Nils Winkler
729f21c106
Reading bash-it help lists aliases from global enabled directory
2017-09-17 21:05:58 +02:00
Nils Winkler
c26476f56e
Fixed bash-it help aliases for todo.txt-cli
2017-09-17 21:05:58 +02:00
Nils Winkler
e0554cb512
Test cases and fix for bash-it help aliases foo
2017-09-17 21:05:58 +02:00
Nils Winkler
4cda9c0a43
Started work on bash-it help aliases
2017-09-17 21:05:58 +02:00
Nils Winkler
5ff873e058
Fixed "bash-it help aliases" cases, more to come...
2017-09-17 21:05:58 +02:00
Nils Winkler
9f3ef22538
Describe function supports new directory structure
2017-09-17 21:05:57 +02:00
Nils Winkler
591c8a67f3
Support both enabled formats during migration
2017-09-17 21:05:57 +02:00
Nils Winkler
375515cc6e
Use compgen -G instead of ls for finding enabled components
...
Reference: https://stackoverflow.com/a/34195247/1228454
2017-09-17 21:05:57 +02:00
Nils Winkler
7242cc0927
Fix glob expression for finding enabled components
2017-09-17 21:05:57 +02:00
Nils Winkler
2ac08cae0f
Fix one migration case
2017-09-17 21:05:57 +02:00
Nils Winkler
6fa235a825
Start work on migration to global directory
2017-09-17 21:05:57 +02:00
Nils Winkler
f892269aff
Fix reload function to use the old and the new directory
2017-09-17 21:05:57 +02:00
Nils Winkler
5f3627b9b7
Change the enable/disable functions to use the global directory
2017-09-17 21:05:57 +02:00
Nils Winkler
b106d275a7
Move enable/disable functionality to global enabled directory
2017-09-17 21:05:57 +02:00
Nils Winkler
2581abdf54
Fix some issues that showed the todo.txt-cli aliases in the wrong way
2017-06-24 17:31:31 +02:00
Nils Winkler
94e68b96b5
Fix migration of todo.txt-cli component
2017-06-24 17:31:31 +02:00
Nils Winkler
732b287a57
Run migrate command after a succesful update
2017-06-24 17:31:31 +02:00
Nils Winkler
f221f63d7d
Add completion for help command, and help for migrate
2017-06-24 17:31:31 +02:00
Nils Winkler
0d9a0987d9
Fixed missing quotes around $BASH_IT variable
...
This should fix most issues where Bash-it is installed in a directory
containing spaces.
2017-06-24 17:31:30 +02:00
Nils Winkler
951fe918c0
Automatically running migration command when enabling/disabling components
2017-06-24 17:31:30 +02:00
Nils Winkler
0039534517
Renamed a couple of variables
2017-06-24 17:31:30 +02:00
Nils Winkler
c2446c2692
Added new "bash-it migrate" command that migrates components from the old syntax to the new one that uses the load priority
2017-06-24 17:31:30 +02:00
Nils Winkler
b1481038d8
Improved check for components that are already enabled
2017-06-24 17:31:30 +02:00
Nils Winkler
4e16dfde56
Fixed basename usage for enable all
2017-06-24 17:31:30 +02:00
Nils Winkler
65c6e6a1a6
Disable all command and test case
2017-06-24 17:31:30 +02:00
Nils Winkler
cc8621a888
Disabling a single component will support both patterns
...
The old pattern with just the name (node.plugin.bash) and the new one
with the load priority (250---node.plugin.bash).
2017-06-24 17:31:30 +02:00
Nils Winkler
dce0ac5b34
Adjusted show function to use the new format
2017-06-24 17:31:30 +02:00
Nils Winkler
feb05b279b
Changed enable all functionality to call recursive enable
2017-06-24 17:31:30 +02:00
Nils Winkler
74b15b6385
Reading load priority from file
2017-06-24 17:31:30 +02:00
Nils Winkler
31dd740571
Added default priority for enable
2017-06-24 17:31:30 +02:00
Maik Ellerbrock
017f3f43d0
fix(docker): fixes "bash-it help plugins" error
2017-05-27 02:34:35 +02:00
Dayne Broderson
3450e20857
adding ability to set theme as a path to specific file
2017-03-24 00:23:12 -08:00
Nils Winkler
99bf5f09ad
Moved grep alias to general aliases
2017-01-09 18:13:10 +01:00
Nils Winkler
38bfc93270
Merge pull request #834 from edubxb/fix-765
...
Fix search command for RedHat based distributions
2017-01-03 08:45:33 +01:00
Adam Karim
2a4e27cdba
Updating README.
...
Fixing custom location for themes.
2016-11-29 09:55:13 -08:00
Eduardo Bellido Bellido
5f2a4b5d8b
Fix search command for RedHat based distributions
2016-11-14 01:26:10 +01:00
Levent YALCIN
e1f4283b64
indentation fix
2016-11-04 18:15:07 +00:00
Levent YALCIN
1b98e39f5a
ignorespace is a good one other than shopt
2016-11-04 18:14:45 +00:00
Kevin Glowacz
bd52e16895
Remove `continue` from conditional
...
This is an artifact left over from when this function was extracted from
inside a loop b524bb6047
However, `continue` isn't doing anything when not inside a loop and this
now raises a warning in bash 4.4:
"continue: only meaningful in a `for', `while', or `until' loop"
2016-09-22 10:55:22 -05:00
Thomas Bouve
afe8b0d8ec
Fix for bash-it help plugins error (pathmunge group value).
2016-08-06 23:41:27 +02:00
Eric Anders
3b56275ef6
Check for empty or whitespace PROMPT_COMMAND before appending preexec_invoke_cmd
2016-08-04 15:51:15 -05:00
Nick Silva
f82b57b046
Merge branch 'master' into autoreload
2016-08-01 11:25:47 -07:00
Nick Silva
16b455d0c6
add BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE option
2016-08-01 11:19:17 -07:00
Nick Silva
2d7881022a
Remove hyphen from bash when reloading
2016-07-22 17:43:07 -07:00
Nick Silva
fb85db14a9
763: Automatically reload shell after enabling and disabling things.
2016-07-22 16:15:31 -07:00
Nick Silva
bbcb50ca2b
Remove stray debugging echoes
2016-07-19 11:38:36 -07:00
Nick Silva
7c8be52ac5
Revert local variable declaration
2016-07-19 11:17:49 -07:00
Nick Silva
7c1370ac00
Add support for custom alias group with alias help command.
2016-07-19 11:12:36 -07:00
Konstantin Gredeskoul
db5061cf80
Better tests, more resilience and a bug fix
2016-05-12 04:04:51 -07:00
Konstantin Gredeskoul
1a02db13bc
Adding documentation
2016-05-07 06:39:40 -07:00
Konstantin Gredeskoul
9bb2d377a8
Enable/Disable with negated search feature
2016-05-07 06:26:30 -07:00
Konstantin Gredeskoul
fb6a6c80c0
Highlighting color of enabled components
2016-05-07 04:23:03 -07:00
Konstantin Gredeskoul
ffbeeacc54
Moving search into its own module before more work
2016-05-07 04:19:03 -07:00
Travis Swicegood
1e826eefb4
Allow overriding name of remote
2016-03-25 18:03:41 -05:00
Konstantin Gredeskoul
fd3d305fad
Faster search, and cleaner completion
2016-03-24 02:54:30 -07:00
Konstantin Gredeskoul
c0a657270c
Add bash-it search functionality
...
- "bash-it search term1 [term2]...."
- we are using existing 'bash-it show plugins|aliases|completions'
commands output, to search (with grep) for lines that match the
search terms, and then output the matches.
- wrote a simple unit test that for whatever reason fails on Travis,
so wrapped it in 'if "Darwin"'...
2016-03-23 23:13:51 -07:00
James Cuzella
3c9fecf967
Make all vars defined in lib/history.bash overridable. Set these before sourcing Bash-It with .bashrc or .bash_profile to override defaults
2016-03-11 11:28:11 -07:00
Eduardo Bellido Bellido
48f26406f0
Apply new naming convention
2016-02-09 22:49:08 +01:00
Eduardo Bellido Bellido
1dba074024
Fix variable syntax error
2016-02-05 18:47:57 +01:00
Eduardo Bellido Bellido
3438c1d7c4
New update command
2016-02-05 00:13:41 +01:00
Don Reilly
d589f95477
Allow custom themes to be in $BASH_IT/custom/themes
2015-11-24 15:55:06 -06:00
Nils Winkler
18836b1a0c
Merge pull request #588 from crazygit/upstream
...
add bulk enable or disable function
2015-10-27 10:42:19 +01:00
crazygit
a42e5f4d73
add bulk enable or disable function
2015-10-23 00:07:35 +08:00
Dwight Holman
503fc7bede
Basename -s is platform specific, so use Bash's variable expansion instead.
2015-10-14 16:58:40 -07:00
Ivan Povalyukhin
119b8696ad
[history-bash] remote unused export call; cleanup history.bash file
2015-06-17 14:17:27 -07:00
Ivan Povalyukhin
1cb9093c9c
[pathmunge] fix test and modify metadata syntax in the function pathmunge to be easier supported in the test
2015-06-07 20:23:19 -07:00
Ivan Povalyukhin
cf3728c5aa
[pathmunge] added function to prevent duplicates in PATH variable
2015-05-30 00:26:22 -07:00
Ivan Povalyukhin
ce4562decc
rename lib/composure.{sh,bash} for consistency and to allow load helper work in tests
2015-03-28 18:54:37 -07:00
Ivan Povalyukhin
540b946333
[code-gardening] rm duplicate definition of transcribe function in lib/composure.sh
2015-03-23 15:17:59 -07:00
Nils Winkler
d29d6df2f2
Added support for `bash-it help completions` command.
...
It's showing the same output as `bash-it show completions`,
to keep things simple.
2015-03-23 08:18:48 +01:00
Matt Wismer
0c70325542
Use basename instead of sed
2015-01-06 16:50:44 -05:00
MattWis
a9e8f10e35
Add ability to preview themes
2015-01-06 16:50:05 -05:00
Benjamin Brombach
4b60298939
Fixed #157 : Made 'type' command using default LANG (not system LANG) to check if function or alias.
2014-12-03 13:51:32 +01:00
Sergio Pieiga
e91f1a0aeb
grep v2.21 compatibility
...
grep v2.21 depracates GREP_OPTIONS env var
2014-11-27 08:29:45 -05:00