From 64221e94503cc8711a4ec4c75002296e8574df1e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 16 Apr 2016 21:39:11 -0400 Subject: [PATCH] define-builder! now accepts functions/commands + better pwd handling --- core/defuns/defuns-quickrun.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/core/defuns/defuns-quickrun.el b/core/defuns/defuns-quickrun.el index 8d075b638..e79a0fda2 100644 --- a/core/defuns/defuns-quickrun.el +++ b/core/defuns/defuns-quickrun.el @@ -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 ;;;;;;;;;;;;;;;;;;;;;;