Function: ghostel--install-built-module-after-compilation

ghostel--install-built-module-after-compilation is a natively compiled function defined in ghostel-module-install.el.

Signature

(ghostel--install-built-module-after-compilation BUF STATUS)

Documentation

Move the module built by an interactive compile in BUF on successful STATUS.

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel-module-install.el
(defun ghostel--install-built-module-after-compilation (buf status)
  "Move the module built by an interactive compile in BUF on successful STATUS."
  (when (buffer-live-p buf)
    (with-current-buffer buf
      (let ((build-dir ghostel--module-compile-build-dir)
            (dest-dir ghostel--module-compile-dest-dir))
        (when (and build-dir dest-dir)
          (let ((file-name (concat "ghostel-module" module-file-suffix))
                (sidecar "ghostel-module.version"))
            (unwind-protect
                (when (string-match-p "finished" status)
                  (let ((built (expand-file-name file-name build-dir))
                        (final (expand-file-name file-name dest-dir))
                        (built-sidecar (expand-file-name sidecar build-dir))
                        (final-sidecar (expand-file-name sidecar dest-dir)))
                    (when (file-exists-p built)
                      (condition-case err
                          (progn
                            (ghostel--install-module-pair
                             built final built-sidecar final-sidecar)
                            (ghostel--install-support-assets dest-dir)
                            (message "ghostel: module installed at %s" final))
                        (error
                         (display-warning
                          'ghostel
                          (format "Build succeeded but installing into %s failed: %s"
                                  dest-dir (error-message-string err))))))))
              (when (file-directory-p build-dir)
                (ignore-errors (delete-directory build-dir t))))))))))