Skip to content

Commit

Permalink
Show whether data files were updated in import-currencies.php
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Mar 19, 2019
1 parent cc4d180 commit f258bca
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion import-currencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,14 @@
*/
function exportToFile($file, $data)
{
file_put_contents($file, sprintf("<?php return %s;\n", export($data)));
$data = sprintf("<?php return %s;\n", export($data));

if (file_get_contents($file) === $data) {
printf("%s: no change\n", $file);
} else {
file_put_contents($file, $data);
printf("%s: UPDATED\n", $file);
}
}

/**
Expand Down

0 comments on commit f258bca

Please sign in to comment.