Commit Graph

11 Commits (150f73ee50e70a0f9d101818d604a0a76c28a83f)

Author SHA1 Message Date
John D Pell 5eab3bd288 lib/helpers: first `shellcheck` pass
Quote things, SC2268, SC2143, SC2181, SC2162, SC2016, SC2013, &c.

Rewrite globbing per `shellcheck`’s SC2013, and alsö s/typeset/local/g. Eliminate `compgen` where possible.

Alsö: use the existing utility functions `_bash-it-get-component-type-from-path` and `_bash-it-get-component-name-from-path`, which just use parameter substitution anyway. Why was `sed` here?

Alsö, don't add not-existing directories to `$PATH` in `pathmunge()`.

Finally, merge PR #1865 from NoahGorny...and clean it a bit...
2022-01-18 11:02:21 -08:00
John D Pell da6b27166f tests: new file `test_helper_libs.bash`
For testing non-core files, just `load ../test_helper_libs` after `load ../test_helper` instead of trying to guess which libs must be loaded, in which order, for testing to succeed.

`_command_exists` spews log messages, so our test log is littered with `_log_debug not found`. This fixes that too.
2022-01-08 08:29:13 -08:00
John D Pell 9dcbeec7ad tests: test_helper already loads `composure.sh`
...and `cite()`s metadata
2022-01-08 08:29:13 -08:00
cornfeedhobo b7feb14404
skip go tests when go is not available 2021-09-29 18:16:52 -05:00
Noah Gorny 1fbd91ebf9
Merge pull request #1824 from cornfeedhobo/goenv-go
Ensure goenv and go play together well
2021-02-06 00:14:07 +02:00
cornfeedhobo e690f21e4e
Ensure goenv and go play together well
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.
2021-02-04 23:51:17 -06:00
buhl 49d7d2e8c4 Getting Bash-it to use the vendored composure
Fixed tests
Fixed install.sh and bash_it.sh
Added gitattributes to the vendor folder
Changed documentation
2021-02-02 16:34:04 +01:00
Alex Thiessen c003f0f342
test/plugins/go: Skip tests in absence of `go`
In case `go` is not installed, tests of the according plugin fail. It's
better to just skip them since `golang` isn't commonly installed on
`bash-it` developers' machines.

In CI environment, no tests should be skipped, so run them anyway.
2020-04-10 00:03:39 +00:00
cornfeedhobo 377f02714d Simplify multiple path support in go plugin (#1284)
* simplify wrapped pathmunge logic. update tests to account for cases with spaces in $PATH.
2019-11-20 08:49:34 +01:00
cornfeedhobo 1030c0e9e1
one more test ... why not 2018-12-06 17:11:13 -05:00
cornfeedhobo 3645305644
add go plugin tests and update list reversal logic 2018-12-06 17:07:03 -05:00