You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
801 B

(defun my/dwim-shell-command/0x0-upload ()
"Upload the marked files to"
(let ((url ""))
"0x0 upload"
(format "curl -Ffile=@<<f>> -Fsecret= %s" url)
:utils "curl"
;; Insert the single quotes at the appropriate place according to
;; example online:
;; curl -F'file=@yourfile.png' -Fsecret=
;; The placement of these single quotes confuse the escaping
;; mechanisms of dwim-shell-command, as it considers @ as the
;; opening 'quote' as it appears right in front of <<f>>.
(lambda (template path)
(string-replace "-Ffile" "-F'file"
(string-replace path (concat path "'") template))))))