summaryrefslogtreecommitdiff
path: root/chickadee
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2021-10-24 11:50:14 -0400
committerDavid Thompson <dthompson2@worcester.edu>2021-10-24 11:50:14 -0400
commit7837d810d7859fc595aac9b98a59e7b6955ca991 (patch)
tree74841b77fd5d941a52bf6459fb461cf9ddfadf2d /chickadee
parent9028c2caf111aa1030ba402f4116f33d898a6479 (diff)
cli: bundle: Add project directory to load path.
Diffstat (limited to 'chickadee')
-rw-r--r--chickadee/cli/bundle.scm12
1 files changed, 10 insertions, 2 deletions
diff --git a/chickadee/cli/bundle.scm b/chickadee/cli/bundle.scm
index 3a3fe68..0e3ad3b 100644
--- a/chickadee/cli/bundle.scm
+++ b/chickadee/cli/bundle.scm
@@ -399,11 +399,19 @@ Create a redistributable binary tarball using the settings in FILE, or
(define %default-options '())
(define (chickadee-bundle . args)
+ (define (make-bundle* file-name)
+ ;; Ensure file-name is an absolute file name.
+ (let ((file-name (if (string-prefix? "/" file-name)
+ file-name
+ (string-append (getcwd) "/" file-name))))
+ (add-to-load-path (dirname file-name))
+ (set! %load-compiled-path (cons (dirname file-name) %load-compiled-path))
+ (make-bundle (primitive-load file-name))))
(let ((opts (simple-args-fold args %options %default-options)))
(match (operands opts)
(()
- (make-bundle (primitive-load "bundle.scm")))
+ (make-bundle* "bundle.scm"))
((file-name)
- (make-bundle (primitive-load file-name)))
+ (make-bundle* file-name))
(_
(leave "too many arguments specified. just pass a Scheme file name.")))))