mirror of
https://github.com/YunoHost-Apps/dokuwiki_ynh.git
synced 2024-09-03 18:26:20 +02:00
Change method to "automatic upgrade" of plugins
This commit is contained in:
parent
d9e9f93281
commit
3006e4345d
2 changed files with 22 additions and 10 deletions
|
@ -17,7 +17,7 @@ YNH_PHP_VERSION=8.1
|
|||
# For more information, see the PHP application helper: https://github.com/YunoHost/yunohost/blob/dev/helpers/php#L3-L6
|
||||
# Or this app package depending on PHP: https://github.com/YunoHost-Apps/grav_ynh/blob/master/scripts/_common.sh
|
||||
# PHP dependencies used by the app (must be on a single line)
|
||||
php_dependencies="php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-gd"
|
||||
php_dependencies="php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-cli"
|
||||
# or, if you do not need a custom YNH_PHP_VERSION:
|
||||
###php_dependencies="php$YNH_DEFAULT_PHP_VERSION-deb1 php$YNH_DEFAULT_PHP_VERSION-deb2"
|
||||
|
||||
|
|
|
@ -283,15 +283,27 @@ fi
|
|||
|
||||
# TODO Taken from old "upgrade" script. Should check if it is needed and what it does
|
||||
# Update all plugins
|
||||
for name_plugin in $(sudo -s cat $final_path/lib/plugins/*/plugin.info.txt | grep url | awk -F ':' '{print $3}');
|
||||
do
|
||||
# Get a official plugin for dokuwiki, not update a no-official
|
||||
wget -nv --quiet "https://github.com/splitbrain/dokuwiki-plugin-$name_plugin/zipball/master" -O "${name_plugin}.zip" -o /dev/null || true
|
||||
if [ -s "${name_plugin}.zip" ]; then
|
||||
unzip ${name_plugin}.zip
|
||||
cp -a splitbrain-dokuwiki-plugin-${name_plugin}*/. "$final_path/lib/plugins/$name_plugin/"
|
||||
fi
|
||||
done
|
||||
###for name_plugin in $(sudo -s cat $final_path/lib/plugins/*/plugin.info.txt | grep url | awk -F ':' '{print $3}');
|
||||
###do
|
||||
### # Get a official plugin for dokuwiki, not update a no-official
|
||||
### wget -nv --quiet "https://github.com/splitbrain/dokuwiki-plugin-$name_plugin/zipball/master" -O "${name_plugin}.zip" -o /dev/null || true
|
||||
### if [ -s "${name_plugin}.zip" ]; then
|
||||
### unzip ${name_plugin}.zip
|
||||
### cp -a splitbrain-dokuwiki-plugin-${name_plugin}*/. "$final_path/lib/plugins/$name_plugin/"
|
||||
### fi
|
||||
###done
|
||||
|
||||
# if "file" exists and is executable
|
||||
# Stolen from https://github.com/YunoHost-Apps/grav_ynh/blob/testing/scripts/upgrade#L189
|
||||
if [ -x "$final_path/bin/plugin.php" ]; then
|
||||
pushd "$final_path"
|
||||
ynh_exec_warn_less ynh_exec_as $app php${YNH_PHP_VERSION} bin/plugin.php --no-colors extension upgrade || ynh_print_warn --message="Automatic plugin upgrade has failed, you can upgrade them from your DokuWiki admin panel."
|
||||
popd
|
||||
else
|
||||
ynh_print_warn --message="Automatic plugin cannot be done, you have to upgrade them from your DokuWiki admin panel."
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue