From e0b243ba93f94df9faa48ceeaeaa4647dc31bd27 Mon Sep 17 00:00:00 2001 From: Neraud Date: Fri, 3 Aug 2018 15:39:12 +0200 Subject: [PATCH] Improved how the statefile last modified date is updated --- plugins/git/git_commit_behind | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/git/git_commit_behind b/plugins/git/git_commit_behind index 96a9d5f8..adde3f4f 100755 --- a/plugins/git/git_commit_behind +++ b/plugins/git/git_commit_behind @@ -101,6 +101,7 @@ GPLv2 import logging import os +from pathlib import Path from random import randint import re from subprocess import check_output, call, DEVNULL, CalledProcessError @@ -231,7 +232,9 @@ def do_update_repos(): logging.error('Repo not found at path %s' % repos_conf[repo_code]['path']) logging.debug('Updating the state file') - open(conf['state_file'], 'w') + + # 'touch' the state file to update its last modified date + Path(conf['state_file']).touch() if len(sys.argv) > 1: