Improve mkdir so that permissions will be forced:

SFTP will honor umask on server side, and new directories won't get
expected permissions. We need to explicitly set permissions metadata for
new entries.
This commit is contained in:
Thibault Jouan
2014-09-25 21:28:21 +00:00
parent bd66ec25e4
commit 25935f8302
3 changed files with 8 additions and 6 deletions

View File

@@ -9,10 +9,8 @@ module Producer
def apply
Pathname.new(path).descend do |p|
next if fs.dir? p
case arguments.size
when 1 then fs.mkdir p.to_s
when 2 then fs.mkdir p.to_s, mode
end
fs.mkdir p.to_s
fs.chmod p.to_s, mode if mode
end
end