Skip to content

Commit

Permalink
Merge pull request #1 from purcell/patch-1
Browse files Browse the repository at this point in the history
Misc fixes
  • Loading branch information
olymk2 committed Nov 6, 2016
2 parents b849f31 + d51e453 commit 1d4ee03
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions drone.el
@@ -1,4 +1,4 @@
;;; drone.el --- Launch your drone test suite, searches for drone.yml and runs if found -*- lexical-binding: t; -*-
;;; drone.el --- Launch your drone test suite if drone.yml is present -*- lexical-binding: t; -*-

;; Copyright (C) 2016 Oliver Marks

Expand All @@ -23,25 +23,28 @@

;;; Commentary:

;; This provides a single non interactive command which will launch this shell command "drone exec"
;; This will look for a .drone.yml file and run the command from this path
;; The output of running the tests will be displayed to the user
;; Drone is an application that runs your tests using docker, it can run both locally and on drone.io server
;; This provides a single interactive command which will run the
;; shell command "drone exec". This will look for a .drone.yml file
;; and run the command from this path. The output of running the
;; tests will be displayed to the user. Drone is an application that
;; runs your tests using docker, it can run both locally and on
;; drone.io server.

;;; Code:

(defun drone-root ()
(condition-case nil
(let ((root-path (locate-dominating-file default-directory ".drone.yml")))
(if root-path
root-path
(error "Missing .drone.yml not found in directory tree")))))
(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)))
(compilation-start (format "drone exec"))))
(with-current-buffer (get-buffer-create (concat "*drone: " default-directory "*"))
(compilation-start (format "drone exec")
nil
(lambda (_) (buffer-name))))))

(provide 'drone)
;;; drone.el ends here
(provide 'drone)

0 comments on commit 1d4ee03

Please sign in to comment.