Pull in s3ed

This commit is contained in:
Jeremy Dormitzer 2020-04-17 14:16:53 -04:00
parent 7d3ebeae7f
commit 8bac9ecbd0

View File

@ -4809,18 +4809,14 @@ Syntax highlighting for Dockerfiles:
* AWS * AWS
** S3 ** S3
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun save-to-s3 (bucket public) (use-package s3ed
(interactive "MS3 bucket URL (e.g. s3://bucket/filename): \nP") :commands (s3ed-mode
(let* ((tmp-file (make-temp-file "s3-upload")) s3ed-find-file
(cmd `("aws" "s3" "cp" ,@(if public '("--acl" "public-read")) ,tmp-file ,bucket))) s3ed-save-file)
(setq last-s3-url bucket) :init
(write-region (point-min) (point-max) tmp-file) (jdormit/define-prefix "fS" "s3")
(let ((proc (apply #'start-process "aws-s3" "*aws-s3*" cmd))) (leader-def-key "fSf" #'s3ed-find-file)
(set-process-sentinel (leader-def-key "fSs" #'s3ed-save-file))
proc
(make-success-err-msg-sentinel "*aws-s3*"
(format "Uploaded to %s" last-s3-url)
"Failed to upload to s3, check *aws-s3* buffer for details")))))
#+END_SRC #+END_SRC
* Prodigy * Prodigy