[Updater] Save diff files into subdirectory

master
ntimo 2019-08-25 16:41:52 +02:00
parent 9b526d40a8
commit 96af23e9a2
No known key found for this signature in database
GPG Key ID: 3AF3627FB0440D55
2 changed files with 5 additions and 2 deletions

2
.gitignore vendored
View File

@ -33,7 +33,7 @@ data/conf/portainer/
data/gitea/
data/gogs/
data/conf/sogo/plist_ldap
diff_before_update_*
update_diffs/
.github/
docker-compose.override.yml
refresh_images.sh

View File

@ -328,8 +328,11 @@ if [[ ! "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
exit 0
fi
DIFF_FILE=diff_before_update_$(date +"%Y-%m-%d-%H-%M-%S")
DIFF_DIRECTORY=update_diffs
DIFF_FILE=${DIFF_DIRECTORY}/diff_before_update_$(date +"%Y-%m-%d-%H-%M-%S")
echo -e "\e[32mSaving diff to ${DIFF_FILE}...\e[0m"
mkdir -p ${DIFF_DIRECTORY}
mv diff_before_update* ${DIFF_DIRECTORY}/ 2> /dev/null
git diff --stat > ${DIFF_FILE}
git diff >> ${DIFF_FILE}