adjust the names of the dot/neato binaries to be platform-specific

original commit: 71595a55e67f4701eae93bd60d52d785d83cef6f
This commit is contained in:
Robby Findler 2012-01-17 12:41:44 -06:00
parent dc8edd7062
commit 92d21649fb

View File

@ -13,7 +13,7 @@
(define neato-ipsep-label "neato ipsep")
;; these paths are explicitly checked (when find-executable-path
;; fails) because starting drscheme from the finder (or the doc)
;; fails) because starting drracket from the finder (or the dock)
;; under mac os x generally does not get the path right.
(define dot-paths
'("/usr/bin"
@ -21,17 +21,20 @@
"/usr/local/bin"
"/opt/local/bin/"))
(define dot.exe (if (eq? (system-type) 'windows) "dot.exe" "dot"))
(define neato.exe (if (eq? (system-type) 'windows) "neato.exe" "neato"))
(define (find-dot [neato? #f])
(cond
[(and (find-executable-path "dot")
(find-executable-path "neato"))
[(and (find-executable-path dot.exe)
(find-executable-path neato.exe))
(if neato?
(find-executable-path "neato")
(find-executable-path "dot"))]
(find-executable-path neato.exe)
(find-executable-path dot.exe))]
[else
(ormap (λ (x) (and (file-exists? (build-path x "dot"))
(file-exists? (build-path x "neato"))
(build-path x (if neato? "neato" "dot"))))
(ormap (λ (x) (and (file-exists? (build-path x dot.exe))
(file-exists? (build-path x neato.exe))
(build-path x (if neato? neato.exe dot.exe))))
dot-paths)]))
(define (dot-positioning pb option overlap?)