[fix] update test for date function in data download script

This commit is contained in:
Al
2016-12-09 19:29:00 -05:00
parent 14fa8a08c0
commit c3f3896b48

View File

@@ -115,7 +115,7 @@ download_file() {
curl $url --retry 3 --retry-delay 2 -o $local_path
fi
if date -ur . >/dev/null 2>&1; then
if date -d "@$(date -ur . +%s)" >/dev/null 2>&1; then
echo $(date -d "$(date -d "@$(date -ur $local_path +%s)") + 1 second") > $updated_path;
elif stat -f %Sm . >/dev/null 2>&1; then
echo $(date -r $(stat -f %m $local_path) -v+1S) > $updated_path;