forked from platformio/platformio-core
Better support for file contents writing // Issue #2796
This commit is contained in:
@@ -220,14 +220,12 @@ def is_prog_obsolete(prog_path):
|
||||
break
|
||||
shasum.update(data)
|
||||
new_digest = shasum.hexdigest()
|
||||
old_digest = None
|
||||
if isfile(prog_hash_path):
|
||||
with open(prog_hash_path, "r") as fp:
|
||||
old_digest = fp.read()
|
||||
old_digest = (
|
||||
fs.get_file_contents(prog_hash_path) if isfile(prog_hash_path) else None
|
||||
)
|
||||
if new_digest == old_digest:
|
||||
return False
|
||||
with open(prog_hash_path, "w") as fp:
|
||||
fp.write(new_digest)
|
||||
fs.write_file_contents(prog_hash_path, new_digest)
|
||||
return True
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user