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.
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.
This will ensure users will specify whether they want to overwrite the
backup or not, and check it even when we do silent installation
This does change the default behaviour and exits if the -f flag is not
specified and a backup is present.
55fdb9f Merge pull request #24 from bvberkum/pr-21
b360ca5 Use command name, not last argument as shell-name [#23]
5c458c9 22 - Document revise behavior with GUI editors
7de4304 Update LICENSE copyright
f784e3a Merge pull request #20 from akatrevorjay/pr/zsh-plugin
1901dbe Merge pull request #19 from DrVanScott/master
6bcbc7b Add zsh-style plugin for easy load
37bccee fix _typeset_functions_about for functions starting with a dash
27623a9 fix zsh specific issues
2efc446 glossary: list only functions containing 'about'
7899d11 glossary: call _typeset_functions only once
072856e shell(): Fix for cygwin environment
2dc31de avoid error message if gprintf does not exist
git-subtree-dir: vendor/github.com/erichs/composure
git-subtree-split: 55fdb9fa3cd0f181208a46d90da4d87d5b7e4351
This PR seeks to address several issues surrounding the go and goenv plugins.
The nature of goenv allows for a situation where the initial shell does not
point to a working go binary, and instead at the included shim script. The
result is that one must run reload after moving to a project directory with a
version file, however in doing so, PATH is updated, requiring they exit the
shell or risk lookup collisions and unexpected behavior.
This is solved by using preexec to check the version before changing
directories and restarting the shell if the version has changed. The exec
pattern is copied from _bash-it-restart, but is edited to support this specific
use case.
Additionally, tests have been uploaded and these are now being linted.