Handle AWS SSO login buffer cleanup
Added process sentinel to close the *aws-sso-login* buffer when the AWS SSO login process finishes
This commit is contained in:
parent
f9b49ef7b6
commit
77138e6dc9
@ -30,7 +30,16 @@
|
||||
|
||||
(defun aws-sso-login ()
|
||||
(interactive)
|
||||
(async-shell-command "AWS_PROFILE=default aws sso login"))
|
||||
(let ((buffer "*aws-sso-login*"))
|
||||
(async-shell-command "AWS_PROFILE=default aws sso login" buffer)
|
||||
(with-current-buffer buffer
|
||||
(let ((proc (get-buffer-process (current-buffer))))
|
||||
(set-process-sentinel
|
||||
proc
|
||||
(lambda (proc sentinel)
|
||||
(when (string-match-p "finished" sentinel)
|
||||
(with-selected-window (get-buffer-window (process-buffer proc) t)
|
||||
(quit-window)))))))))
|
||||
|
||||
(add-hook 'emacs-startup-hook
|
||||
(lambda ()
|
||||
|
Loading…
Reference in New Issue
Block a user