summaryrefslogtreecommitdiff
path: root/main.rkt
blob: 82441167769cabbd7bf19ed5bb63104db3d2552a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#lang racket/base
(require racket/runtime-path)
(define-runtime-path here ".")
(define-runtime-path modules "modules")

(define (add-library-path path)
  (current-library-collection-paths
    (cons path (current-library-collection-paths))))

(define vendor (getenv "VENDOR"))
(when vendor (add-library-path (string->path vendor)))

(add-library-path here)

(define (require-path p)
  (dynamic-require `(file ,(path->string p)) #f))

(for ([f (directory-list modules #:build? #t)])
  (if (file-exists? f)
    (require-path f)
    (require-path (build-path f "default.rkt"))))