From 93183284f7cf866645fe06dd78c8e862e5863757 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 26 Jul 2010 14:46:06 -0500 Subject: [PATCH] `raco' supports relative module paths in `raco-command' "info.rkt" entries --- collects/raco/all-tools.rkt | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/collects/raco/all-tools.rkt b/collects/raco/all-tools.rkt index b877f3ee71..4875cf212c 100644 --- a/collects/raco/all-tools.rkt +++ b/collects/raco/all-tools.rkt @@ -25,15 +25,28 @@ (when p (fprintf (current-error-port) - "warning: tool ~s registered twice: ~e and ~e" + "warning: tool ~s registered twice: ~e and ~e\n" (car entry) (car p) d))) - (hash-set! tools (car entry) entry)] + (let ([entry (let ([e (cadr entry)]) + (if (or (string? e) + (and (pair? e) + (eq? (car e) 'file) + (relative-path? (cadr e)))) + ;; convert absolute path to realive to "info.rkt": + (list* (car entry) + (build-path d (if (pair? e) + (cadr e) + e)) + (cddr entry)) + ;; module path is absolute already: + entry))]) + (hash-set! tools (car entry) entry))] [else (fprintf (current-error-port) - "warning: ~s provided bad `raco-commands' spec: ~e" + "warning: ~s provided bad `raco-commands' spec: ~e\n" d entry)])))) tools))