mirror of
https://github.com/ivabus/pantry
synced 2024-11-10 10:35:17 +03:00
Make files writable before trying to write
This commit is contained in:
parent
972f0715f4
commit
037a34701c
|
@ -80,8 +80,15 @@ class Fixer
|
|||
end
|
||||
|
||||
def write
|
||||
stat = File.stat(@file.filename)
|
||||
if not stat.writable?
|
||||
File.chmod(0644, @file.filename)
|
||||
chmoded = true
|
||||
end
|
||||
@file.write!
|
||||
@changed = true
|
||||
ensure
|
||||
File.chmod(stat.mode, @file.filename) if chmoded
|
||||
end
|
||||
|
||||
def links_to_other_tea_libs?
|
||||
|
|
Loading…
Reference in a new issue