1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/borgserver_ynh.git synced 2024-09-03 20:36:20 +02:00

[fix] Missing helper

This commit is contained in:
ljf 2018-11-29 00:01:41 +01:00
parent eb42ff9091
commit b79bfafd67

View file

@ -59,6 +59,17 @@ ynh_configure () {
ynh_store_file_checksum $2 ynh_store_file_checksum $2
} }
ynh_read_json () {
sudo python3 -c "import sys, json;print(json.load(open('$1'))['$2'])"
}
ynh_read_manifest () {
if [ -f '../manifest.json' ] ; then
ynh_read_json '../manifest.json' "$1"
else
ynh_read_json '../settings/manifest.json' "$1"
fi
}
# Checks the app version to upgrade with the existing app version and returns: # Checks the app version to upgrade with the existing app version and returns:
# - UPGRADE_APP if the upstream app version has changed # - UPGRADE_APP if the upstream app version has changed
# - UPGRADE_PACKAGE if only the YunoHost package has changed # - UPGRADE_PACKAGE if only the YunoHost package has changed