branch: externals/dape
commit 44544b3caf19ff35446858be089d6415db10b2c9
Author: Daniel Pettersson <[email protected]>
Commit: Daniel Pettersson <[email protected]>

    Improve ensure fn for js-debug
---
 dape.el | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/dape.el b/dape.el
index 52667d85a9..f5de1cd30b 100644
--- a/dape.el
+++ b/dape.el
@@ -145,15 +145,12 @@
              `(modes (js-mode js-ts-mode)
                ensure ,(lambda (config)
                          (dape-ensure-command config)
-                         (let* ((command-cwd
-                                 (dape--config-eval-value (plist-get config 
'command-cwd)))
-                                (command
-                                 (file-name-concat command-cwd
-                                                   (dape--config-eval-value 
(car (plist-get config 'command-args))))))
-                           (unless (file-exists-p command-cwd)
-                             (user-error "Directory %s does not exist" 
command-cwd))
-                           (unless (file-exists-p command)
-                             (user-error "Command %s does not exist" 
command))))
+                         (let ((js-debug-file
+                                (file-name-concat
+                                 (dape--config-eval-value (plist-get config 
'command-cwd))
+                                 (dape--config-eval-value (car (plist-get 
config 'command-args))))))
+                           (unless (file-exists-p js-debug-file)
+                             (user-error "File %S does not exist" 
js-debug-file))))
                command "node"
                command-cwd ,(file-name-concat dape-adapter-dir
                                               "js-debug")

Reply via email to