[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ssh-deploy 0e93dd6044 1/2: Implementation of new flag s
From: |
Christian Johansson |
Subject: |
[elpa] externals/ssh-deploy 0e93dd6044 1/2: Implementation of new flag ssh-deploy-run-script-on-explicit-save |
Date: |
Sat, 1 Jul 2023 05:06:13 -0400 (EDT) |
branch: externals/ssh-deploy
commit 0e93dd6044a7f3fcd2938da39522719d7c779790
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Implementation of new flag ssh-deploy-run-script-on-explicit-save
---
README.md | 3 ++-
ssh-deploy.el | 12 ++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 1d5428361f..b2a9633005 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ The `ssh-deploy` plug-in for Emacs makes it possible to
effortlessly deploy loca
* Delete files and directories on local host and have it mirrored on the remote
* Open corresponding file on the remote host
* Open SQL database-session on remote hosts
-* Run custom deployment scripts
+* Run custom deployment scripts, make scripts run when saving file inside
directory
* All operations support asynchronous mode if `(make-thread`) or `async.el` is
installed. (You need to setup an automatic authorization for this, i.e.
`~/.authinfo.gpg` and/or key-based password-less authorization)
* Tries to follow best-practice both in terms of performance and code style
@@ -39,6 +39,7 @@ Here is a list of other variables you can set globally or per
directory:
* `ssh-deploy-automatically-detect-remote-changes` Enables automatic detection
of remote changes *(integer)*
* `ssh-deploy-on-explicit-save` Enabled automatic uploads on save *(integer)*
* `ssh-deploy-force-on-explicit-save` Enables forced uploads on explicit save
actions *(integer)*
+* `ssh-deploy-run-script-on-explicit-save' - Enabled automatic running of the
deployment script on save *(integer)*
* `ssh-deploy-exclude-list` A list defining what paths to exclude from
deployment *(list)*
* `ssh-deploy-async` Enables asynchronous transfers (you need to have
`(make-thread)` or `async.el` installed as well) *(integer)*
* `ssh-deploy-remote-sql-database` Default database when connecting to remote
SQL database *(string)*
diff --git a/ssh-deploy.el b/ssh-deploy.el
index 3d61f855d1..3226eefe09 100644
--- a/ssh-deploy.el
+++ b/ssh-deploy.el
@@ -117,6 +117,8 @@
;; * `ssh-deploy-revision-folder' - The folder used for storing local
revisions *(string)*
;; * `ssh-deploy-automatically-detect-remote-changes' - Enables automatic
detection of remote changes *(integer)*
;; * `ssh-deploy-on-explicit-save' - Enabled automatic uploads on save
*(integer)*
+;; * `ssh-deploy-force-on-explicit-save' -- Enables forced uploads on explicit
save actions *(integer)*
+;; * `ssh-deploy-run-script-on-explicit-save' - Enabled automatic running of
the deployment script on save *(integer)*
;; * `ssh-deploy-exclude-list' - A list defining what file names to exclude
from deployment *(list)*
;; * `ssh-deploy-async' - Enables asynchronous transfers (you need to have
`(make-thread)` or `async.el` available as well) *(integer)*
;; * `ssh-deploy-remote-sql-database' - Default database when connecting to
remote SQL database *(string)*
@@ -171,6 +173,12 @@
(put 'ssh-deploy-on-explicit-save 'permanent-local t)
(put 'ssh-deploy-on-explicit-save 'safe-local-variable 'integerp)
+(defcustom ssh-deploy-run-script-on-explicit-save 0
+ "Boolean variable if deploy script should be executed on explicit save, 0 by
default."
+ :type 'integer)
+(put 'ssh-deploy-run-script-on-explicit-save 'permanent-local t)
+(put 'ssh-deploy-run-script-on-explicit-save 'safe-local-variable 'integerp)
+
(defcustom ssh-deploy-force-on-explicit-save 0
"Boolean variable if deploy on explicit save
should be forced or not, 0 by default."
@@ -1424,6 +1432,10 @@ if it is configured for deployment."
(defun ssh-deploy-after-save () "Logic for automatic uploads."
+ (when (and (boundp 'ssh-deploy-run-script-on-explicit-save)
+ ssh-deploy-run-script-on-explicit-save
+ (> ssh-deploy-run-script-on-explicit-save 0))
+ (ssh-deploy-run-deploy-script-handler))
(when (and (boundp 'ssh-deploy-on-explicit-save)
ssh-deploy-on-explicit-save
(> ssh-deploy-on-explicit-save 0))