git_pull: fix restart_ignore for subdirectories (#516)

* git_pull: fix restart_ignore for subdirectories

* Update config.json

* Update CHANGELOG.md
This commit is contained in:
Fréderic Kinnaer
2019-01-25 15:10:46 +01:00
committed by Pascal Vizeli
parent a84f63cc76
commit 9f2d6102ce
3 changed files with 6 additions and 3 deletions

View File

@@ -1,5 +1,8 @@
# Changelog
## 7.2
- Fix restart_ignore when specifying a sub-directory
## 7.1
- Enhance restart_ignore to support whole directories
- Fix repeat option: don't terminate if internet connection unavailable during a check

View File

@@ -1,6 +1,6 @@
{
"name": "Git pull",
"version": "7.1",
"version": "7.2",
"slug": "git_pull",
"description": "Simple git pull to update the local configuration",
"url": "https://home-assistant.io/addons/git_pull/",

View File

@@ -185,14 +185,14 @@ function validate-config {
for changed_file in $CHANGED_FILES; do
restart_required_file=""
for restart_ignored_file in $RESTART_IGNORED_FILES; do
if [ -z "${restart_ignored_file#*/}" ]; then
if [ -d "$restart_ignored_file" ]; then
# file to be ignored is a whole dir
restart_required_file=$(echo "${changed_file}" | grep "^${restart_ignored_file}")
else
restart_required_file=$(echo "${changed_file}" | grep "^${restart_ignored_file}$")
fi
# break on first match
if [ -n "$restart_required_file" ]; then break ; fi
if [ -n "$restart_required_file" ]; then break; fi
done
if [ -z "$restart_required_file" ]; then
DO_RESTART="true"