|
|
@ -27,23 +27,28 @@
|
|
|
|
(very-nice-path (car args)))))
|
|
|
|
(very-nice-path (car args)))))
|
|
|
|
|
|
|
|
|
|
|
|
(define (dispatch command-name)
|
|
|
|
(define (dispatch command-name)
|
|
|
|
(with-logging-to-port
|
|
|
|
(define dispatch-thunk
|
|
|
|
(current-error-port)
|
|
|
|
(λ ()
|
|
|
|
(λ ()
|
|
|
|
(case command-name
|
|
|
|
(case command-name
|
|
|
|
[("test" "xyzzy") (handle-test)]
|
|
|
|
[("test" "xyzzy") (handle-test)]
|
|
|
|
[(#f "help") (handle-help)]
|
|
|
|
[(#f "help") (handle-help)]
|
|
|
|
[("start") (handle-start)] ; parses its own args
|
|
|
|
[("start") (handle-start)] ; parses its own args
|
|
|
|
;; "second" arg is actually third in command line args, so use cddr not cdr
|
|
|
|
;; "second" arg is actually third in command line args, so use cddr not cdr
|
|
|
|
[("render") (handle-render)] ; render parses its own args from current-command-line-arguments
|
|
|
|
[("render") (handle-render)] ; render parses its own args from current-command-line-arguments
|
|
|
|
[("version") (handle-version)]
|
|
|
|
[("version") (handle-version)]
|
|
|
|
[("reset") (handle-reset (get-first-arg-or-current-dir))]
|
|
|
|
[("reset") (handle-reset (get-first-arg-or-current-dir))]
|
|
|
|
[("setup") (handle-setup)]
|
|
|
|
[("setup") (handle-setup)]
|
|
|
|
[("clone" "publish") (handle-publish)]
|
|
|
|
[("clone" "publish") (handle-publish)]
|
|
|
|
[else (handle-unknown command-name)])))
|
|
|
|
[else (handle-unknown command-name)]))
|
|
|
|
(cond
|
|
|
|
#:logger pollen-logger
|
|
|
|
[(let ([str (getenv "PLTSTDERR")])
|
|
|
|
'info
|
|
|
|
(and str (regexp-match "@pollen" str))) (dispatch-thunk)]
|
|
|
|
'pollen))
|
|
|
|
[else (with-logging-to-port
|
|
|
|
|
|
|
|
(current-error-port)
|
|
|
|
|
|
|
|
dispatch-thunk
|
|
|
|
|
|
|
|
#:logger pollen-logger
|
|
|
|
|
|
|
|
'info
|
|
|
|
|
|
|
|
'pollen)]))
|
|
|
|
|
|
|
|
|
|
|
|
(define (very-nice-path x)
|
|
|
|
(define (very-nice-path x)
|
|
|
|
(path->complete-path (simplify-path (cleanse-path (->path x)))))
|
|
|
|
(path->complete-path (simplify-path (cleanse-path (->path x)))))
|
|
|
|