Publish script: avoid find-file-noselect + fixes
A doom change now causes a y-or-n-p prompt to appear, so we need to make that non-interactive.
This commit is contained in:
parent
2deea5c05d
commit
00d1a88ef7
|
@ -57,6 +57,10 @@ jobs:
|
|||
- name: Export config
|
||||
run: ~/.config/doom/misc/config-publishing/publish.sh
|
||||
|
||||
# - name: Debug failure over SSH (tmate)
|
||||
# if: ${{ failure() }}
|
||||
# uses: mxschmitt/action-tmate@v3.1
|
||||
|
||||
- name: Deploy
|
||||
if: ${{ github.event_name != 'pull_request'}}
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
|
|
|
@ -32,14 +32,14 @@
|
|||
|
||||
(message "[34] Opening package file")
|
||||
|
||||
(with-current-buffer (find-file-noselect (expand-file-name "packages.el" config-root))
|
||||
(with-temp-buffer
|
||||
(insert-file-contents (expand-file-name "packages.el" config-root))
|
||||
(message "[34] Checking for updates")
|
||||
(setq package-upgrades (doom/bump-packages-in-buffer))
|
||||
(goto-char (point-min))
|
||||
(setq total-packages 0)
|
||||
(while (search-forward "(package!" nil t)
|
||||
(setq total-packages (1+ total-packages)))
|
||||
(kill-buffer (current-buffer)))
|
||||
(setq total-packages (1+ total-packages))))
|
||||
|
||||
(message "[32] %s total packages" total-packages)
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
(let ((output-file (expand-file-name
|
||||
(htmlize-make-file-name (file-name-nondirectory file))
|
||||
(file-name-directory file))))
|
||||
(with-current-buffer (find-file-noselect file)
|
||||
(with-current-buffer (find-file-literally file)
|
||||
(normal-mode)
|
||||
(font-lock-ensure)
|
||||
(set-buffer-modified-p nil)
|
||||
|
|
|
@ -71,10 +71,14 @@
|
|||
|
||||
(if full
|
||||
(load (expand-file-name "~/.emacs.d/init.el"))
|
||||
(setq gc-cons-threshold 16777216
|
||||
gcmh-high-cons-threshold 16777216)
|
||||
(load (expand-file-name "core/core.el" user-emacs-directory) nil t)
|
||||
(require 'core-cli)
|
||||
(doom-initialize))
|
||||
|
||||
(defalias 'y-or-n-p #'ignore)
|
||||
|
||||
(when (and (featurep 'undo-tree) global-undo-tree-mode)
|
||||
(global-undo-tree-mode -1)
|
||||
(advice-add 'undo-tree-save-history :override #'ignore)))
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
(setq log-file (format "%s-log.txt" (file-name-base load-file-name)))
|
||||
|
||||
(load (expand-file-name "initialise.el" (file-name-directory load-file-name)) nil t)
|
||||
(initialise)
|
||||
(initialise t)
|
||||
|
||||
;;; Actually do the exporting now
|
||||
|
||||
|
@ -12,11 +12,16 @@
|
|||
(expand-file-name "config.org" config-root))
|
||||
|
||||
(require 'vc) ; need this for modification-time macro
|
||||
(require 'org)
|
||||
|
||||
(setq org-mode-hook nil)
|
||||
(with-current-buffer (find-file-noselect (expand-file-name "config.org" config-root))
|
||||
(message "[33] Exporting %s" (buffer-file-name))
|
||||
(org-html-export-to-html))
|
||||
(with-temp-buffer
|
||||
(let ((buffer-file-name (expand-file-name "config.org" config-root))
|
||||
(org-export-coding-system org-html-coding-system)
|
||||
org-mode-hook)
|
||||
(insert-file-contents (expand-file-name "config.org" config-root))
|
||||
(message "[33] Exporting %s" (buffer-file-name))
|
||||
(org-export-to-file 'html (expand-file-name "config.html" config-root))))
|
||||
|
||||
(publish "config.html" "misc/*.svg")
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
;; non-zero exit code
|
||||
(message (format "[31] %s process failed!%s"
|
||||
,(file-name-base (eval file))
|
||||
(space-fill-line ,(length (file-name-base (eval file))))))
|
||||
(space-fill-line ,(+ 16 (length (file-name-base (eval file)))))))
|
||||
(message "\033[0;31m %s\033[0m"
|
||||
'unmodified
|
||||
(with-temp-buffer
|
||||
|
@ -51,7 +51,8 @@
|
|||
(defun space-fill-line (base-length)
|
||||
"Return whitespace such that the line will be filled to overwrite the status line."
|
||||
(make-string (max 0
|
||||
(- (apply #'+ (mapcar (lambda (dep) (length (plist-get dep :padded-name))) dependent-processes))
|
||||
(- (apply #'+ (* 2 (1- (length dependent-processes)))
|
||||
(mapcar (lambda (dep) (length (plist-get dep :padded-name))) dependent-processes))
|
||||
base-length))
|
||||
? ))
|
||||
|
||||
|
@ -68,7 +69,7 @@
|
|||
(defun process-status-table ()
|
||||
(message (concat
|
||||
"\033[1m[%4.1fs] \033[0;1m"
|
||||
(mapconcat (lambda (dep) (plist-get dep :padded-name)) dependent-processes " ")
|
||||
(mapconcat (lambda (dep) (plist-get dep :padded-name)) dependent-processes " ")
|
||||
"\n\033[0m "
|
||||
(mapconcat (lambda (dep)
|
||||
(apply #'format (format "%%s%%-%ds" (length (plist-get dep :padded-name)))
|
||||
|
@ -76,7 +77,7 @@
|
|||
('run '("\033[0;33m" "Active"))
|
||||
('exit '("\033[0;32m" "Complete")))))
|
||||
dependent-processes
|
||||
" ")
|
||||
" ")
|
||||
"\033[0;90m[1A[K[1A[K")
|
||||
'unmodified
|
||||
(- (float-time) start-time)))
|
||||
|
@ -97,6 +98,8 @@
|
|||
(let ((proc (plist-get dep :proc)))
|
||||
(when (not (eq (process-status proc) 'exit))
|
||||
(message "[1;31] Killing %s%s" proc (space-fill-line (+ 6 (length (format "%s" proc)))))
|
||||
(signal-process proc 'SIGUSR2)
|
||||
(sleep-for 0.2)
|
||||
(delete-process proc)
|
||||
(message "\n\033[0;31m %s\033[0m"
|
||||
'unmodified
|
||||
|
@ -110,8 +113,8 @@
|
|||
(sleep-for 0.5)))
|
||||
|
||||
(if (= 0 exit-code)
|
||||
(message "[1;32] Config publish content generated!%s" (space-fill-line 31))
|
||||
(message "[1;31] Config publishing aborted%s" (space-fill-line 23)))
|
||||
(message "[1;32] Config publish content generated!%s" (space-fill-line 33))
|
||||
(message "[1;31] Config publishing aborted%s" (space-fill-line 25)))
|
||||
|
||||
(setq inhibit-message t)
|
||||
(kill-emacs exit-code)
|
||||
|
|
Loading…
Reference in New Issue