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

@@ -20,6 +20,10 @@ module Producer
false
end
def chmod(path, mode)
sftp.setstat! path, permissions: mode
end
def mkdir(path, mode = nil)
options = mode ? { permissions: mode } : {}
sftp.mkdir! path, options