Created
July 15, 2023 16:05
-
-
Save xenodium/4bb138ade9f476ff71e03e6529f4c875 to your computer and use it in GitHub Desktop.
dwim-shell-commands-duplicate tramp experiment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun dwim-shell-commands-duplicate () | |
(interactive) | |
(dwim-shell-command-on-marked-files | |
"Duplicate file(s)." | |
"cp '<<f>>' '<<f(u)>>'" | |
:utils '("cp" "scp") | |
:post-process-template | |
(lambda (script file) | |
(if (tramp-tramp-file-p file) | |
;; Tramp file path start with "/ssh:". Drop it. | |
(string-replace "/ssh:" "" | |
(replace-regexp-in-string "^cp" "scp" script)) | |
script)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment