lib/ash/common.rb in capistrano-ash-1.1.16 vs lib/ash/common.rb in capistrano-ash-1.1.17
- old
+ new
@@ -39,5 +39,15 @@
# Params:
# +dir_path+
def remote_dir_exists?(dir_path)
'true' == capture("if [[ -d #{dir_path} ]]; then echo 'true'; fi").strip
end
+
+# set the permissions for files recurisvely from the starting directory (dir_path)
+def set_perms_files(dir_path, perm = 644)
+ try_sudo "find #{dir_path} -type f -exec chmod #{perm} {} \\;"
+end
+
+# set the permissions for directories recurisvely from the starting directory (dir_path)
+def set_perms_dirs(dir_path, perm = 755)
+ try_sudo "find #{dir_path} -type d -exec chmod #{perm} {} \\;"
+end