diff options
author | William Carroll <wpcarro@gmail.com> | 2020-08-27T17·27+0100 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2020-08-27T17·29+0100 |
commit | 78172233f808f60000b5aa87a1cf92746b856c0c (patch) | |
tree | 75bf9b005fa70e56b85b8bead5e21db5c2b15021 /ci/pipelines/script.el | |
parent | d67dbec7e82b7c907d7c1c4fa92ae922abeca059 (diff) |
Add build, lint Emacs steps to post-receive pipeline
TL;DR: - Define runEmacsScript to emacs/default.nix for ci/pipelines/post-receive - Write script.el to call (load init.el) and catch any errors - Lint Elisp with gonewest818/elisp-lint Also nice how Buildkite supports :gnu: emojis!
Diffstat (limited to 'ci/pipelines/script.el')
-rw-r--r-- | ci/pipelines/script.el | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ci/pipelines/script.el b/ci/pipelines/script.el new file mode 100644 index 000000000000..45b5ea688500 --- /dev/null +++ b/ci/pipelines/script.el @@ -0,0 +1,28 @@ +;; This script initializes Emacs and exits with either a zero or non-zero status +;; depending on whether or not Emacs initialized without logging warnings or +;; encountering errors. +;; +;; This script reads the location of init.el as the last argument in `argv'. + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dependencies +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(require 'dash) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Script +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(condition-case err + (load (-last-item argv)) + (error + (message "Encountered an error while attempting to load init.el: %s" err) + (kill-emacs 1))) + +(if (bufferp "*Warnings*") + (progn + (with-current-buffer "*Warnings*" + (message "Encountered warnings in *Warnings* buffer: %s" (buffer-string))) + (kill-emacs 1)) + (kill-emacs 0)) |