From b79bfafd670b9b07f22dde3fd55a47ea8b7bf11b Mon Sep 17 00:00:00 2001 From: ljf Date: Thu, 29 Nov 2018 00:01:41 +0100 Subject: [PATCH] [fix] Missing helper --- scripts/_common.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index 4bb26b6..c8c1531 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -59,6 +59,17 @@ ynh_configure () { 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: # - UPGRADE_APP if the upstream app version has changed # - UPGRADE_PACKAGE if only the YunoHost package has changed