From a53b1723a78087c5ba2a1f3376548e11e69f2ed5 Mon Sep 17 00:00:00 2001 From: Gofannon <17145502+Gofannon@users.noreply.github.com> Date: Tue, 1 May 2018 22:23:43 +0200 Subject: [PATCH] fix missing helper with _common.sh --- scripts/_common.sh | 13 +++++++++++++ scripts/backup | 12 ++++++------ scripts/install | 2 +- scripts/remove | 8 +------- scripts/restore | 12 ++++++------ scripts/upgrade | 2 +- 6 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 scripts/_common.sh diff --git a/scripts/_common.sh b/scripts/_common.sh new file mode 100644 index 0000000..bb04a03 --- /dev/null +++ b/scripts/_common.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# ============= FUTURE YUNOHOST HELPER ============= +# Delete a file checksum from the app settings +# +# $app should be defined when calling this helper +# +# usage: ynh_remove_file_checksum file +# | arg: file - The file for which the checksum will be deleted +ynh_delete_file_checksum () { + local checksum_setting_name=checksum_${1//[\/ ]/_} # Replace all '/' and ' ' by '_' + ynh_app_setting_delete $app $checksum_setting_name +} \ No newline at end of file diff --git a/scripts/backup b/scripts/backup index f86bc5d..9e9c186 100644 --- a/scripts/backup +++ b/scripts/backup @@ -6,12 +6,12 @@ # IMPORT GENERIC HELPERS #================================================= -#if [ ! -e _common.sh ]; then -# # Get the _common.sh file if it's not in the current directory -# cp ../settings/scripts/_common.sh ./_common.sh -# chmod a+rx _common.sh -#fi -#source _common.sh +if [ ! -e _common.sh ]; then + # Get the _common.sh file if it's not in the current directory + cp ../settings/scripts/_common.sh ./_common.sh + chmod a+rx _common.sh +fi +source _common.sh source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/install b/scripts/install index 5bc8f3b..4cf7704 100644 --- a/scripts/install +++ b/scripts/install @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#source ./_common.sh +source ./_common.sh source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/remove b/scripts/remove index 48e5bcf..2381d20 100644 --- a/scripts/remove +++ b/scripts/remove @@ -6,13 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#if [ ! -e _common.sh ]; then -# # Get file fonction if not been to the current directory -# sudo cp ../settings/scripts/_common.sh ./_common.sh -# sudo chmod a+rx _common.sh -#fi -# Source app helpers -#source _common.sh +source _common.sh source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/restore b/scripts/restore index 27f0f95..66a5447 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,12 +6,12 @@ # IMPORT GENERIC HELPERS #================================================= -#if [ ! -e _common.sh ]; then -# # Get the _common.sh file if it's not in the current directory -# cp ../settings/scripts/_common.sh ./_common.sh -# chmod a+rx _common.sh -#fi -#source _common.sh +if [ ! -e _common.sh ]; then + # Get the _common.sh file if it's not in the current directory + cp ../settings/scripts/_common.sh ./_common.sh + chmod a+rx _common.sh +fi +source _common.sh source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f787e44..d267063 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#source _common.sh +source _common.sh source /usr/share/yunohost/helpers #=================================================