Change tabs to spaces, move 'if, then' on a single line instead of splitted lines

This commit is contained in:
Félix Piédallu 2024-01-10 23:34:28 +01:00
parent 021125aa33
commit 2a9127168e
4 changed files with 45 additions and 49 deletions

View file

@ -33,8 +33,7 @@ get__amount() {
local amount=200 local amount=200
# It's possible to change some properties of the question by overriding it: # It's possible to change some properties of the question by overriding it:
if [ "$amount" -gt 100 ] if [ "$amount" -gt 100 ]; then
then
cat << EOF cat << EOF
style: success style: success
value: $amount value: $amount
@ -54,8 +53,7 @@ EOF
get__prices() { get__prices() {
local prices local prices
prices="$(grep "DONATION\['" "$install_dir/settings.py" | sed -r "s@^DONATION\['([^']*)'\]\['([^']*)'\] = '([^']*)'@\1/\2/\3@g" | sed -z 's/\n/,/g;s/,$/\n/')" prices="$(grep "DONATION\['" "$install_dir/settings.py" | sed -r "s@^DONATION\['([^']*)'\]\['([^']*)'\] = '([^']*)'@\1/\2/\3@g" | sed -z 's/\n/,/g;s/,$/\n/')"
if [ "$prices" == "," ]; if [ "$prices" == "," ]; then
then
# Return YNH_NULL if you prefer to not return a value at all. # Return YNH_NULL if you prefer to not return a value at all.
echo YNH_NULL echo YNH_NULL
else else

View file

@ -30,8 +30,7 @@ ynh_script_progression --message="Removing system configurations related to $app
# This should be a symetric version of what happens in the install script # This should be a symetric version of what happens in the install script
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) # Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status "$app" >/dev/null if ynh_exec_warn_less yunohost service status "$app" >/dev/null; then
then
ynh_script_progression --message="Removing $app service integration..." --weight=1 ynh_script_progression --message="Removing $app service integration..." --weight=1
yunohost service remove "$app" yunohost service remove "$app"
fi fi

View file

@ -44,16 +44,16 @@ upgrade_type=$(ynh_check_app_version_changed)
# #
# If db_name doesn't exist, create it # If db_name doesn't exist, create it
#if [ -z "$db_name" ]; then # if [ -z "$db_name" ]; then
# db_name=$(ynh_sanitize_dbid --db_name=$app) # db_name=$(ynh_sanitize_dbid --db_name=$app)
# ynh_app_setting_set --app=$app --key=db_name --value=$db_name # ynh_app_setting_set --app=$app --key=db_name --value=$db_name
#fi # fi
# If install_dir doesn't exist, create it # If install_dir doesn't exist, create it
#if [ -z "$install_dir" ]; then # if [ -z "$install_dir" ]; then
# install_dir=/var/www/$app # install_dir=/var/www/$app
# ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir
#fi # fi
#================================================= #=================================================
# STOP SYSTEMD SERVICE # STOP SYSTEMD SERVICE
@ -68,8 +68,7 @@ ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$a
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]; then
then
ynh_script_progression --message="Upgrading source files..." --weight=1 ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from manifest.toml # Download, check integrity, uncompress and patch the source from manifest.toml