Commit Graph

9 Commits (435151819f0d76819256d03285fea4004432bee2)

Author SHA1 Message Date
cornfeedhobo 8fcf713541
use absolute paths instead of changing directory 2021-01-31 15:32:23 -06:00
Terminal for Life 921ea9ac76
Optimizations to reloader.bash (#1749)
* Optimized statement with REGEX by using `case`

REGEX is a great feature of BASH, but in this case it was energy
needlessly spent. A `case` statement suffices. Bring in REGEX when
you're going to make good use of it, otherwise it's just going to bog
down your code.

I also wanted to strip the ` || exit 1` on the last line, but I wasn't
sure if this file is meant to be sourced or not; if not, then exiting
like that is redundant because it will already exit with whichever
status the last command provides, unless `popd` specifically offers
unhelpful or no exit statuses.

* Optimize as before but with 2nd REGEX instance

This time is much like the last commit, so I won't repeat, but I will
say that you're using a double- or even triple-negative, which
obfuscates your goal. Where you were doing...

[ ! -n VAR ] &&

You were basically saying this convolution:

If it's true that it's not true that VAR is not empty.

Very confusing. Instead, I've opted for:

If it's true that Var is empty.

Makes immediate sense and is easier to parse, visually speaking.
2020-12-27 17:14:50 +02:00
Noah Gorny 6a4142ced7 scripts: Add logs to reloader.bash 2020-06-30 20:58:09 +03:00
Travis Swicegood 2d6085b033 Switch from false to skip – I think that's more clear 2018-12-05 21:58:13 -06:00
Travis Swicegood 7b32dd6424 Add filtering to the $2 input in addition to $1 2018-12-05 21:54:59 -06:00
Travis Swicegood 5b8f8d874e Default to loading everything
The tests are failing because $1 is being passed through from the
initial loading. When this loads in the shell, $1 is empty though so
the code works-for-me, but just not the tests.

This filters the $1 input to ensure its one of the valid types
expected inside the ./enabled directory.
2018-12-05 21:53:39 -06:00
Travis Swicegood c76263dc47 Ensure this debugging output is generated (oops) 2018-12-05 21:04:55 -06:00
Travis Swicegood 992b87b816 Shellcheck clean up based on comments from @nwinkler 2018-12-05 21:00:59 -06:00
Travis Swicegood e5b68695c0 Attempt to simplify by not using aliases 2018-12-04 22:02:10 -06:00