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

[fix] Correct the removal of old files

This commit is contained in:
Gofannon 2018-06-18 00:16:06 +02:00
parent 6f12b387c9
commit 1d1f0bf8c6

View file

@ -133,10 +133,23 @@ fi
# See https://www.dokuwiki.org/update_check
touch $final_path/doku.php
# Remove deleted files
# Remove files not used anymore after upgrade
# See https://www.dokuwiki.org/install:unused_files
if [ -f "../sources/data/deleted.files" ]; then
grep -Ev '^($|#)' ../sources/data/deleted.files | xargs -I {} sudo rm -vrf $final_path/{}
if [ -f "$final_path/data/deleted.files" ]; then
# Move to the dokuwiki installation folder so the "official" commands can be used without adaptation
cd $final_path
# This command could not remove directory
#grep -Ev '^($|#)' data/deleted.files | xargs -n 1 rm -vf
# => "rm: cannot remove 'vendor/easybook/geshi': Is a directory"
# That one works as expected
grep -Ev '^($|#)' data/deleted.files | xargs -n 1 rm -fr
# bash "hack" to move back to the location user was before the last cd made
# See http://winterdrake.com/unixlinux-trick-cd-back-to-the-previous-directory/
# Should be the script folder of the package
cd -
fi
# Update all plugins