validate CHANNEL, and mark "edge" and "nightly" deprecated

The edge channel was already deprecated; the nightly channel has not been
updated for a long time, so (for now) mark it as deprecated as well.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn committed 2023-05-08 12:52:10 +02:00
1 parent 81857de3b2
commit 0731f2f67c
1 file changed
+15 -2
+15 -2
View File
@@ -25,10 +25,10 @@ SCRIPT_COMMIT_SHA="${LOAD_SCRIPT_COMMIT_SHA}"
VERSION="${VERSION#v}"
# The channel to install from:
# * nightly
# * test
# * stable
# * test
# * edge (deprecated)
# * nightly (unmaintained)
DEFAULT_CHANNEL_VALUE="stable"
if [ -z "$CHANNEL" ]; then
CHANNEL=$DEFAULT_CHANNEL_VALUE
@@ -71,6 +71,19 @@ case "$mirror" in
;;
esac
case "$CHANNEL" in
stable|test)
;;
edge|nightly)
>&2 echo "DEPRECATED: the $CHANNEL channel has been deprecated and no longer supported by this script."
exit 1
;;
*)
>&2 echo "unknown CHANNEL '$CHANNEL': use either stable or test."
exit 1
;;
esac
command_exists() {
command -v "$@" > /dev/null 2>&1
}