From 92d21649fb824d00811a8638cb7d6d8ba1c0a8db Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Tue, 17 Jan 2012 12:41:44 -0600 Subject: [PATCH] adjust the names of the dot/neato binaries to be platform-specific original commit: 71595a55e67f4701eae93bd60d52d785d83cef6f --- collects/redex/private/dot.rkt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/collects/redex/private/dot.rkt b/collects/redex/private/dot.rkt index 3bfb54d7..56620e1d 100644 --- a/collects/redex/private/dot.rkt +++ b/collects/redex/private/dot.rkt @@ -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?)