Skip to content

Commit

Permalink
Try to appease windows (shell-quoting)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrech committed Nov 16, 2023
1 parent c663ee9 commit 72cab2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cider.el
Expand Up @@ -420,7 +420,7 @@ without interfering with classloaders."
(let* ((script-names (map-values cider--enrich-classpath-script-names))
(temp-prefix cider--temp-name-prefix)
(any-name (rx-to-string
`(or (: (or bos "/") (or ,@script-names) (or eos space))
`(or (: (or bos "/" "\\") (or ,@script-names) (or eos space))
(: ,temp-prefix (or ,@script-names))))))
(string-match any-name cmd)))

Expand Down
8 changes: 4 additions & 4 deletions test/cider-tests.el
Expand Up @@ -115,17 +115,17 @@
:to-equal nil)))
(describe "for different path + script-name combinations"
:var* ((paths `("/simple/path/"
,(shell-quote-argument "/tmp/path/ with spaces/")
,(shell-quote-argument "/ssh:!slightly@cra --zy!path #enrich me/")))
,"/tmp/path/ with spaces/"
,"/ssh:!slightly@cra --zy!path #enrich me/"))
(simple-names (map-values cider--enrich-classpath-script-names))
(tmp-names (mapcar (lambda (s) (cider--make-temp-name s)) simple-names))
(all-names (seq-concatenate 'list simple-names tmp-names)))
(cl-loop
for path in paths do
(cl-loop
for name in all-names do
(describe (format "cider--enriched-cmd-p with script: %s" (concat path name))
:var ((script (concat path name)))
(describe (format "cider--enriched-cmd-p with script: %s" (shell-quote-argument (concat path name)))
:var ((script (shell-quote-argument (concat path name))))
(it "is true in basic cases "
(expect (cider--enriched-cmd-p (concat "bash " script " /usr/bin/lein"))
:to-be-truthy)
Expand Down

0 comments on commit 72cab2f

Please sign in to comment.