If a user has $EDITOR set to e.g "subl --wait", then "$EDITOR" (with
quotes) will fail with error "command not found: subl --wait". In other
words, it looks for an executable containing the space and the --wait in
it.
Simply removing the quotes seems to work fine.
This makes the beginning of all files the same and a little simpler.
`${0%/*}` turns "/home/user/repository/bin/blackbox_edit" into
"/home/user/repository/bin", exactly like basename but without eating a
process.
Because other scripts needed `$blackbox_home` I made this into a
standardard variable that's always available.
This also loads _stack_lib.sh always because _blackbox_common.sh
requires it.
blackbox_edit and blackbox_cat use other blackbox scripts internally,
but assume that they will be found on $PATH. In testing it's useful to
be able to run these scripts by pathname without first putting them on
$PATH, and all the other scripts work just fine in these circumstances.
This edit fixes this by prefixing all references to other scripts in
blackbox_edit and blackbox_cat with ${blackbox_home}, which is conveniently
set as part of sourcing _blackbox_common.sh.
* Command no longer need to be run from the base directory of the repo.
* blackbox_edit now asks "are you sure?" and is greatly simplified.
_blackbox_common.sh:
* add_filename_to_cryptlist now accepts paths relative to cwd.
* fail_if_not_on_cryptlist now accepts paths relative to cwd.
* new function: vcs_relative_path reports a path to the file relative to the REPOBASE.
* new function: is_on_cryptlist
plus...
* Some minor performance enhancesments and cleanups.
* confidence_test.sh now tests some commands while not in REPOBASE.