define-builder! now accepts functions/commands + better pwd handling
This commit is contained in:
parent
38df38f9b6
commit
64221e9450
1 changed files with 8 additions and 5 deletions
|
@ -21,11 +21,14 @@ If ARG is nil this function calls `recompile', otherwise it calls
|
|||
(user-error "No build command was set"))
|
||||
(let ((build-file (cdr narf--build-command))
|
||||
(build-cmd (car narf--build-command))
|
||||
(default-directory (narf/project-root)))
|
||||
(if (or (null build-file) (file-exists-p build-file))
|
||||
(if (symbolp build-cmd)
|
||||
(call-interactively build-cmd)
|
||||
(compile (format build-cmd (or arg ""))))
|
||||
(project-dir (narf/project-root)))
|
||||
(if (or (null build-file) (f-exists? (f-expand build-file project-dir)))
|
||||
(if (or (symbolp build-cmd) (functionp build-cmd))
|
||||
(if (commandp build-cmd)
|
||||
(call-interactively build-cmd)
|
||||
(funcall build-cmd))
|
||||
(let ((default-directory project-dir))
|
||||
(compile (format build-cmd (or arg "")))))
|
||||
(error "Could not build!"))))
|
||||
|
||||
;;;; Code running ;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue