Remove execution-specific code in sourcing-only .sh files #1436
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some of the
.sh
script files are only meant ever to be sourced and not to be executed. These are already correctly not marked executable, but some of them contained code that would only be proper for scripts that are actually run, and not for scripts that are only sourced:One contained a
#!
line, which this removes because it falsely indicated an intent to be executed, and because it was not effective even in principle when sourcing the script.Two contained
set -eu
commands affecting the behavior of the running interpreter, which were redundant because the script for which they are helpers already runs such a command. If they are later sourced into other scripts (a use for which they are not intended and would probably require further modification), those other scripts might not have theseset
commands, but in that case those commands' behavior would probably not be wanted.This also adds "Must be sourced into the main journey test" comments at the top of
.sh
files to which they apply, mirroring the presence of such comments in other such files. Besides consistency, this has the advantage of making clear what all the scripts that are meant only for sourcing are being used for.I was originally going to include this in #1435, but it doesn't overlap with the changes there, is not essential to them, probably makes sense to evaluate separately, and could overcomplicate #1435 given the other subtlety raised there relating to which archives that PR should regenerate. So I've opened this separate PR instead.