mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Print a diff of the files when backup by ynh_backup_if_checksum_is_different
This commit is contained in:
parent
2d3ff79683
commit
2f1a517a42
1 changed files with 2 additions and 1 deletions
|
@ -352,7 +352,8 @@ ynh_backup_if_checksum_is_different () {
|
||||||
local backup_file="/home/yunohost.conf/backup/$file.backup.$(date '+%Y%m%d.%H%M%S')"
|
local backup_file="/home/yunohost.conf/backup/$file.backup.$(date '+%Y%m%d.%H%M%S')"
|
||||||
sudo mkdir -p "$(dirname "$backup_file")"
|
sudo mkdir -p "$(dirname "$backup_file")"
|
||||||
sudo cp -a "$file" "$backup_file" # Backup the current file
|
sudo cp -a "$file" "$backup_file" # Backup the current file
|
||||||
echo "File $file has been manually modified since the installation or last upgrade. So it has been duplicated in $backup_file" >&2
|
ynh_print_info "File $file has been manually modified since the installation or last upgrade. So it has been duplicated in $backup_file"
|
||||||
|
ynh_print_info "$(git diff --no-index --patch-with-stat $backup_file $file)"
|
||||||
echo "$backup_file" # Return the name of the backup file
|
echo "$backup_file" # Return the name of the backup file
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue