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