[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ssh-deploy 57f8638 167/173: Fixed issue were no run scr
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ssh-deploy 57f8638 167/173: Fixed issue were no run script was defined |
Date: |
Sat, 20 Oct 2018 10:36:50 -0400 (EDT) |
branch: externals/ssh-deploy
commit 57f8638e081d63f04513aa02b7e6582f355f0113
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Fixed issue were no run script was defined
---
ssh-deploy.el | 41 +++++++++++++++++++++++++++++++++++++----
1 file changed, 37 insertions(+), 4 deletions(-)
diff --git a/ssh-deploy.el b/ssh-deploy.el
index 8635801..1fda4b0 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: 31 July 2018
-;; Version: 1.95
+;; Modified: 14 Aug 2018
+;; Version: 1.97
;; Keywords: tools, convenience
;; URL: https://github.com/cjohansson/emacs-ssh-deploy
@@ -33,7 +33,8 @@
;; ssh-deploy enables automatic deploys on explicit-save actions, manual
uploads, renaming,
;; deleting, downloads, file and directory differences, launching remote
terminals (eshell, shell),
-;; detection of remote changes, remote directory browsing, remote SQL database
sessions via TRAMP.
+;; detection of remote changes, remote directory browsing, remote SQL database
sessions and
+;; running custom deployment scripts via TRAMP.
;;
;; For asynchrous operations it uses package async.el.
;;
@@ -72,6 +73,7 @@
;; (global-set-key (kbd "C-c C-z B") (lambda()
(interactive)(ssh-deploy-browse-remote-handler) ))
;; (global-set-key (kbd "C-c C-z o") (lambda()
(interactive)(ssh-deploy-open-remote-file-handler) ))
;; (global-set-key (kbd "C-c C-z m") (lambda()
(interactive)(ssh-deploy-remote-sql-mysql-handler) ))
+;; (global-set-key (kbd "C-c C-z s") (lambda()
(interactive)(ssh-deploy-run-deploy-script-handler) ))
;;
;; - To install and set-up using use-package and hydra do this:
;; (use-package ssh-deploy
@@ -93,6 +95,7 @@
;; _R_: Rename
;; _b_: Browse Base _B_: Browse Relative
;; _o_: Open current file on remote _m_: Open sql-mysql on remote
+;; _s_: Run deploy script
;; "
;; ("f" ssh-deploy-upload-handler-forced)
;; ("u" ssh-deploy-upload-handler)
@@ -108,7 +111,8 @@
;; ("b" ssh-deploy-browse-remote-base-handler)
;; ("B" ssh-deploy-browse-remote-handler)
;; ("o" ssh-deploy-open-remote-file-handler)
-;; ("m" ssh-deploy-remote-sql-mysql-handler)))
+;; ("m" ssh-deploy-remote-sql-mysql-handler)
+;; ("s" ssh-deploy-run-deploy-script-handler)))
;;
;;
;; Here is an example for SSH deployment,
/Users/Chris/Web/Site1/.dir-locals.el:
@@ -125,6 +129,7 @@
;; (ssh-deploy-root-remote . "/sftp:address@hidden:/var/www/site2/")
;; (ssh-deploy-on-explicit-save . nil)
;; (ssh-deploy-async . nil)
+;; (ssh-deploy-script . (lambda() (let ((default-directory
ssh-deploy-root-remote))(shell-command "bash compile.sh"))))
;; )))
;;
;; Here is an example for FTP deployment,
/Users/Chris/Web/Site3/.dir-locals.el:
@@ -153,6 +158,7 @@
;; * `ssh-deploy-remote-sql-user' - Default user when connecting to remote SQL
database *(string)*
;; * `ssh-deploy-remote-shell-executable' - Default shell executable when
launching shell on remote host
;; * `ssh-deploy-verbose' - Show messages in message buffer when starting and
ending actions, default t *(boolean)*
+;; * `ssh-deploy-script' - Our custom lambda function that will be called
using (funcall) when running deploy script
;;
;; Please see README.md from the same repository for extended documentation.
@@ -194,6 +200,7 @@
(put 'ssh-deploy-debug 'permanent-local t)
(put 'ssh-deploy-debug 'safe-local-variable 'booleanp)
+;; TODO This flag needs to work better, you should not miss any useful
notifications when this is on
(defcustom ssh-deploy-verbose t
"Boolean variable if debug messages should be shown, t by default."
:type 'boolean
@@ -271,6 +278,13 @@
(put 'ssh-deploy-remote-shell-executable 'permanent-local t)
(put 'ssh-deploy-remote-shell-executable 'safe-local-variable 'stringp)
+(defcustom ssh-deploy-script nil
+ "Lambda function to run with `funcall' when
`ssh-deploy-run-deploy-script-handler' is executed."
+ :type 'lambda
+ :group 'ssh-deploy)
+(put 'ssh-deploy-script 'permanent-local t)
+(put 'ssh-deploy-script 'safe-local-variable 'funcp)
+
(defconst ssh-deploy--status-idle 0
"The idle mode-line status.")
@@ -1305,12 +1319,22 @@
(let ((root-local (file-truename ssh-deploy-root-local)))
(ssh-deploy-browse-remote root-local root-local ssh-deploy-root-remote
ssh-deploy-exclude-list))))
+;;;### autoload
+(defun ssh-deploy-run-deploy-script-handler ()
+ "Run `ssh-deploy-script' with `funcall'."
+ (interactive)
+ (if (and (boundp 'ssh-deploy-script)
+ ssh-deploy-script)
+ (funcall ssh-deploy-script)
+ (display-warning 'ssh-deploy (format "ssh-deploy-script lacks definition!"
type) :warning)))
+
;;; Menu-bar
;; Creating a new menu pane named Deployment in the menu-bar to the right of
“Tools” menu
;; This is particularly useful when key-bindings are not working because of
some mode
;; overriding them.
+
(define-key-after
global-map
[menu-bar sshdeploy]
@@ -1401,6 +1425,15 @@
(define-key
global-map
+ [menu-bar sshdeploy sc]
+ '("Run script" . ssh-deploy-run-deploy-script-handler))
+(define-key
+ global-map
+ [menu-bar sshdeploy sep7]
+ '("--"))
+
+(define-key
+ global-map
[menu-bar sshdeploy ulf]
'("Forced Upload" . ssh-deploy-upload-handler-forced))
(define-key
- [elpa] externals/ssh-deploy e64a454 149/173: Starting ssh-deploy-mode-line on init, (continued)
- [elpa] externals/ssh-deploy e64a454 149/173: Starting ssh-deploy-mode-line on init, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 519939d 153/173: Fixes for mode-line status as stack, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 16a22f4 157/173: More (when (not to (unless conversions, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy d9bc257 159/173: Updated version, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 5705104 155/173: Fixed issue were status list initialization was not working, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy a1dbc2f 156/173: Using unless instead of (when (not, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 8900586 163/173: Started working on support for deploy script, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy e24f69d 127/173: Fixes 'display-warning throws 'wrong-type-argument error #39, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy e869836 171/173: Added support for asynchronous deployment scripts, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 0ff0f77 152/173: Using a stack for buffer status instead, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 57f8638 167/173: Fixed issue were no run script was defined,
Stefan Monnier <=
- [elpa] externals/ssh-deploy 8ed82d6 060/173: Added force upload handler, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy b53b875 078/173: Improved remote eshell integration, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 08d5778 083/173: Added example hydra to README, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 5e0403c 085/173: Instructions for FTP in macOS 10.13, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 0d8b5de 095/173: Only open directory diff buffer if there was any differences, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 407402d 100/173: Improved documentation about interaction-free password-based authentication, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy d0b45f4 106/173: Fixed typos in readme, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 6f54fd5 110/173: Fixed bug where upload file into folder that does not exist on remote, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 9d6d8a4 136/173: Improved comments, trying to trigger MELPA refresh, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy a724653 077/173: Added support for launching remote eshell, Stefan Monnier, 2018/10/20