mirror of
https://github.com/ivabus/pantry
synced 2024-11-23 08:55:07 +03:00
Make files writable before trying to write
This commit is contained in:
parent
972f0715f4
commit
037a34701c
1 changed files with 7 additions and 0 deletions
|
@ -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