 ;;; core/cli/autoloads.el -*- lexical-binding: t; -*-
+
+(require 'autoload)
+
 
 (defvar doom-autoload-excluded-packages '("gh")
   "Packages that have silly or destructive autoload files that try to load

  (message "  M-x doom/restart")
  (message "  M-x doom/reload"))

(defun doom--reload-files (&rest files)
  (if noninteractive
      (add-hook 'doom-cli-post-success-execute-hook #'doom--warn-refresh-session-h)
    (dolist (file files)
      (load-file (byte-compile-dest-file file)))))

(defun doom--byte-compile-file (file)
  (let ((byte-compile-warnings (if doom-debug-mode byte-compile-warnings))
        (byte-compile-dynamic t)
        (byte-compile-dynamic-docstrings t))
    (condition-case e
        (when (byte-compile-file file)
          ;; Give autoloads file a chance to report error
          (load (if doom-debug-mode
                    file
                  (byte-compile-dest-file file))
                nil t))
      ((debug error)
       (let ((backup-file (concat file ".bk")))
         (print! (warn "Copied backup to %s") (relpath backup-file))

         (noninteractive t)
         (backup-inhibited t)
         (version-control 'never)
         (case-fold-search nil)  ; reduce magic
         (autoload-timestamps nil)

         ;; Where we'll store the files we'll scan for autoloads. This should
