The first function drone-root
simply searches for .drone.yml
by searching up the file system tree from the current files path.
The second function drone-exec
runs drone exec
and output the results to a new buffer called *drone:
.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
(defun drone-root ()
(or (locate-dominating-file default-directory ".drone.yml")
(error "Missing .drone.yml not found in directory tree")))
;;;###autoload
(defun drone-exec ()
"Run \"drone exec\" where .drone.yml is found."
(interactive)
(let ((default-directory (drone-root)))
(with-current-buffer (get-buffer-create (concat "*drone: " default-directory "*"))
(compilation-start (format "drone exec")
nil
(lambda (_) (buffer-name))))))
|