Closed UndeadKernel closed 1 year ago
Yeah I would define a upload script that uploads the specific files, I’ll give an example when I’m at my computer
Here is an example, I haven't tested it, please let me know if it doesn't work.
.dir-locals.el
contents:
((nil . (
(ssh-deploy-root-local . "/Users/username/Web/MySite/")
(ssh-deploy-root-remote . "/ssh:myuser@myserver.com|sudo:web@myserver.com:/var/www/MySite/")
(ssh-deploy-script .
(lambda()
(let ((buffer-file-name "myFirstFile.txt"))
(ssh-deploy-upload-handler))
(let ((buffer-file-name "mySecondFile.txt"))
(ssh-deploy-upload-handler))))
)))
When you run the (ssh-deploy-run-deploy-script-handler)
the script should upload both files.
Sorry for being late to the party :D
The solution you propose works when I manually call ssh-deploy-run-deploy-script-handler
. Is it possible to configure ssh-deploy
to call the script automatically when I save a file? My .dir-locals.el file looks like the following and the script is not run automatically on save:
((nil . ((ssh-deploy-root-local . "/home/user/app/")
(ssh-deploy-root-remote . "/ssh:user:/home/user/app/")
(ssh-deploy-on-explicit-save . 1)
(ssh-deploy-script . (lambda()
(let ((buffer-file-name "client"))
(ssh-deploy-upload-handler))
(let ((buffer-file-name "server"))
(ssh-deploy-upload-handler)))))))
I see, I could add a setting for that if you want, like ssh-deploy-run-script-on-save
or something?
Such a setting/feature would be more than welcome @cjohansson.
This should be fixed in commit 0e93dd6044a7f3fcd2938da39522719d7c779790
I was wondering if it is possible to upload a set of files every time I call
ssh-deploy-upload-handler
instead of only the currently opened file. Imagine this setting: I have an org file with some code blocks. These blocks are tangled into their own scripts. When I upload the "main" org file, I also want to upload the associated tangled files.What is the "canonical" way to copy a whole project (e.g., a git repo) onto a remote location while running an
ssh-deploy-*
command within a open file of the project?