Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defcustom rsync-command "rsync"
- "")
- (defcustom rsync-command-options "-ar"
- "")
- (defcustom authorized-key nil
- "")
- (defun rsync-to-server(server)
- (if (not (stringp server))
- nil
- (let* ((local-dir (directory-file-name (expand-file-name ".")))
- (options
- (format "%s %s"
- (if authorized-key
- (concat "-i " authorized-key)
- ""
- )
- rsync-command-options
- ))
- (command
- (format "%s %s %s %s"
- rsync-command
- options
- local-dir
- server)
- )
- )
- ;; (shell-command (format "%s &" command))
- (message "%s" command)
- )
- )
- )
- (setq rsync-server-uris
- '(("no server" . '())
- ("server1" . "/path/to/server")
- ("server2" . "/path/to/server2")))
- (setq helm-rsync-server-uri-sources
- `((name . "Helm for repos on Emacs")
- (candidates . ,rsync-server-uris)
- (action . rsync-to-server)))
- (defun helm-rsync-server ()
- (interactive)
- (helm :sources '(helm-rsync-server-uri-sources))
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement