lib/ash/common.rb in capistrano-ash-1.1.11 vs lib/ash/common.rb in capistrano-ash-1.1.12
- old
+ new
@@ -18,6 +18,16 @@
# Test to see if a file exists by providing
# the full path to the expected file location
def remote_file_exists?(full_path)
'true' == capture("if [ -e #{full_path} ]; then echo 'true'; fi").strip
-end
\ No newline at end of file
+end
+
+# Test to see if a directory exists on a remote
+# server by providing the full path to the expected
+# directory
+#
+# Params:
+# +dir_path+
+def remote_dir_exists?(dir_path)
+ 'true' == capture("if [[ -d #{dir_path} ]]; then echo 'true'; fi").strip
+end