summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.")))))