mirror of
https://github.com/ivabus/pantry
synced 2024-11-23 17:05: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
|
end
|
||||||
|
|
||||||
def write
|
def write
|
||||||
|
stat = File.stat(@file.filename)
|
||||||
|
if not stat.writable?
|
||||||
|
File.chmod(0644, @file.filename)
|
||||||
|
chmoded = true
|
||||||
|
end
|
||||||
@file.write!
|
@file.write!
|
||||||
@changed = true
|
@changed = true
|
||||||
|
ensure
|
||||||
|
File.chmod(stat.mode, @file.filename) if chmoded
|
||||||
end
|
end
|
||||||
|
|
||||||
def links_to_other_tea_libs?
|
def links_to_other_tea_libs?
|
||||||
|
|
Loading…
Reference in a new issue