branch: externals/ssh-deploy
commit aef539bb4feefe927fa48d01736dfadb7b3d7930
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
Create potential missing local directory when downloading file
---
ssh-deploy-diff-mode.el | 6 ++----
ssh-deploy.el | 8 ++++++--
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/ssh-deploy-diff-mode.el b/ssh-deploy-diff-mode.el
index c64a15b..accbeb2 100644
--- a/ssh-deploy-diff-mode.el
+++ b/ssh-deploy-diff-mode.el
@@ -3,8 +3,8 @@
;; Author: Christian Johansson <github.com/cjohansson>
;; Maintainer: Christian Johansson <github.com/cjohansson>
;; Created: 1 Feb 2018
-;; Modified: 22 Feb 2018
-;; Version: 1.13
+;; Modified: 23 Feb 2018
+;; Version: 1.14
;; Keywords: tools, convenience
;; URL: https://github.com/cjohansson/emacs-ssh-deploy
@@ -35,8 +35,6 @@
;;; Code:
-;; TODO: Downloading and deletion of remote files that does not exist on local
root does not work?
-;; TODO: On some FTP hosts, TRAMP wrongly thinks some files are directories
(defvar ssh-deploy-diff-mode nil)
diff --git a/ssh-deploy.el b/ssh-deploy.el
index 4942f03..79b159c 100644
--- a/ssh-deploy.el
+++ b/ssh-deploy.el
@@ -3,8 +3,8 @@
;; Author: Christian Johansson <github.com/cjohansson>
;; Maintainer: Christian Johansson <github.com/cjohansson>
;; Created: 5 Jul 2016
-;; Modified: 22 Feb 2018
-;; Version: 1.78
+;; Modified: 23 Feb 2018
+;; Version: 1.79
;; Keywords: tools, convenience
;; URL: https://github.com/cjohansson/emacs-ssh-deploy
@@ -308,6 +308,8 @@
(let ((file-or-directory (not (file-directory-p ,path-remote))))
(if file-or-directory
(progn
+ (if (not (file-directory-p (file-name-directory
,path-local)))
+ (make-directory (file-name-directory ,path-local) t))
(copy-file ,path-remote ,path-local t t t t)
(copy-file ,path-local ,revision-path t t t t))
(copy-directory ,path-remote ,path-local t t t))
@@ -322,6 +324,8 @@
(if file-or-directory
(progn
(message "Downloading file '%s' to '%s'.. (synchronously)"
path-remote path-local)
+ (if (not (file-directory-p (file-name-directory path-local)))
+ (make-directory (file-name-directory path-local) t))
(copy-file path-remote path-local t t t t)
(ssh-deploy-store-revision path-local revision-folder)
(message "Download of file '%s' finished. (synchronously)"
path-local))