fix a bug introduced in efd2683301

The bug meant that teachpacks whose names ended
in the extension .ss didn't work right.
This commit is contained in:
Robby Findler 2013-08-18 13:54:00 -05:00
parent e4a4a52ea9
commit 5d7faf4c72

View File

@ -103,13 +103,25 @@
values
(for/list ([tp (in-list teachpacks)])
(cond
[(with-handlers ((exn:fail? (λ (x) #f)))
(file-exists? (resolve-module-path tp #f)))
[(has-a-file? tp)
(stepper-skip
(datum->syntax #f `(require ,tp)))]
[else
(eprintf "~a\n" (missing-tp-message tp))]))))
(define (has-a-file? tp)
(define pth
(with-handlers ((exn:fail? (λ (x) #f)))
(resolve-module-path tp #f)))
(and pth
(or (file-exists? pth)
(file-exists?
(bytes->path (regexp-replace #rx#"[.]rkt$"
(path->bytes pth)
#".ss"))))))
(define (missing-tp-message x)
(format "the teachpack '~s' was not found" x))