You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pollen/project-requires.rkt

15 lines
699 B
Racket

#lang racket/base
11 years ago
(require "world.rkt")
(provide (all-defined-out))
(define (project-require-file? path)
(define path-string (path->string path))
(equal? (substring path-string (- (string-length path-string) 3) (string-length path-string)) "rkt"))
;; list of all eligible requires in project require directory
(define (get-project-require-files)
(define extras-directory (build-path (current-directory) world:extras-dir))
(and (directory-exists? extras-directory)
;; #:build? option returns complete paths (instead of just file names)
(let ([files (filter project-require-file? (directory-list extras-directory #:build? #t))])
(and (not (equal? '() files)) files))))