Pull in s3ed
This commit is contained in:
parent
7d3ebeae7f
commit
8bac9ecbd0
@ -4809,18 +4809,14 @@ Syntax highlighting for Dockerfiles:
|
||||
* AWS
|
||||
** S3
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defun save-to-s3 (bucket public)
|
||||
(interactive "MS3 bucket URL (e.g. s3://bucket/filename): \nP")
|
||||
(let* ((tmp-file (make-temp-file "s3-upload"))
|
||||
(cmd `("aws" "s3" "cp" ,@(if public '("--acl" "public-read")) ,tmp-file ,bucket)))
|
||||
(setq last-s3-url bucket)
|
||||
(write-region (point-min) (point-max) tmp-file)
|
||||
(let ((proc (apply #'start-process "aws-s3" "*aws-s3*" cmd)))
|
||||
(set-process-sentinel
|
||||
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")))))
|
||||
(use-package s3ed
|
||||
:commands (s3ed-mode
|
||||
s3ed-find-file
|
||||
s3ed-save-file)
|
||||
:init
|
||||
(jdormit/define-prefix "fS" "s3")
|
||||
(leader-def-key "fSf" #'s3ed-find-file)
|
||||
(leader-def-key "fSs" #'s3ed-save-file))
|
||||
#+END_SRC
|
||||
|
||||
* Prodigy
|
||||
|
Loading…
Reference in New Issue
Block a user