project-path has been added to project DSL

This commit is contained in:
Sameer Rahmani 2018-03-22 17:46:57 +00:00
parent 2a5a7302dc
commit a4533dc45d
1 changed files with 3 additions and 3 deletions

View File

@ -5,13 +5,13 @@
"This hashmap is responsible for storing project configurations.")
;; DSL -----------------------------------------------------
(defmacro deftask (name body)
(defmacro deftask (name &rest body)
"Create a new task for the project with the given NAME and BODY."
`(let ((pmap (gethash __project-name__
open-project-configurations
(make-hash-table :test 'equal))))
(puthash ,(symbol-name name) (lambda (buffer) ,body) pmap)
(puthash ,(symbol-name name) (lambda (project-path buffer) ,@body) pmap)
(puthash __project-name__ pmap open-project-configurations)))
(defmacro run-shell-command (command)
@ -34,7 +34,7 @@
(let* ((project-hash (gethash project open-project-configurations))
(task (gethash task-name project-hash))
(buf (with-buffer project task-name)))
(funcall task buf)))
(funcall task project buf)))
(defun execute-run-task ()
"Execute the :run task for the current project."