Fix ynh_app_upstream_version : restore ability to read manifest

The documentation was saying A, the code was doing B, and calling
functions were expecting both A and B (see
ynh_check_app_version_changed). So this commit aims at making
everyone agree, by matching usage.
This commit is contained in:
Augustin Trancart 2020-09-19 15:29:38 +02:00
parent 15d749fe5a
commit ffcd0e33ac

View file

@ -417,7 +417,7 @@ ynh_read_manifest () {
jq ".$manifest_key" "$manifest" --raw-output
}
# Read the upstream version from the manifest
# Read the upstream version from the manifest, or from the env variable $YNH_APP_MANIFEST_VERSION if not given
#
# usage: ynh_app_upstream_version [--manifest="manifest.json"]
# | arg: -m, --manifest= - Path of the manifest to read
@ -437,7 +437,13 @@ ynh_app_upstream_version () {
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
version_key=$YNH_APP_MANIFEST_VERSION
if [[ "$manifest" != "" ]] && [[ -e "$manifest" ]];
then
version_key=$(ynh_read_manifest --manifest="$manifest" --manifest_key="version")
else
version_key=$YNH_APP_MANIFEST_VERSION
fi
echo "${version_key/~ynh*/}"
}