|
|
@ -9,19 +9,20 @@
|
|
|
|
#lang racket/base
|
|
|
|
#lang racket/base
|
|
|
|
(require pollen/command)
|
|
|
|
(require pollen/command)
|
|
|
|
; pollen setup run on ~a"
|
|
|
|
; pollen setup run on ~a"
|
|
|
|
(string-trim racket-path)
|
|
|
|
racket-path
|
|
|
|
(format "~a at ~a" (make-datestamp) (make-timestamp))))
|
|
|
|
(format "~a at ~a" (make-datestamp) (make-timestamp))))
|
|
|
|
|
|
|
|
|
|
|
|
(define (setup)
|
|
|
|
(define (setup)
|
|
|
|
(define cd (current-directory))
|
|
|
|
(define cd (current-directory))
|
|
|
|
(message (format "Setting up ~a as a pollen directory" cd))
|
|
|
|
(message (format "Setting up ~a as a pollen directory" cd))
|
|
|
|
|
|
|
|
|
|
|
|
(define racket-path (with-output-to-string (λ() (system "which racket"))))
|
|
|
|
(define racket-path (string-trim (with-output-to-string (λ() (system "which racket")))))
|
|
|
|
(define path-to-racket-exists? (> (len racket-path) 0))
|
|
|
|
(define path-to-racket-exists? (> (len racket-path) 0))
|
|
|
|
|
|
|
|
|
|
|
|
(if path-to-racket-exists?
|
|
|
|
(if path-to-racket-exists?
|
|
|
|
(let ([polcom-data (make-polcom-data racket-path)]
|
|
|
|
(let ([polcom-data (make-polcom-data racket-path)]
|
|
|
|
[polcom-filename "polcom"])
|
|
|
|
[polcom-filename "polcom"])
|
|
|
|
|
|
|
|
(message (format "Using ~a as racket path" racket-path))
|
|
|
|
(when (file-exists? polcom-filename)
|
|
|
|
(when (file-exists? polcom-filename)
|
|
|
|
(begin
|
|
|
|
(begin
|
|
|
|
(message (format "Deleting existing polcom file in ~a" cd))
|
|
|
|
(message (format "Deleting existing polcom file in ~a" cd))
|
|
|
@ -31,7 +32,7 @@
|
|
|
|
(display-to-file polcom-data polcom-filename)
|
|
|
|
(display-to-file polcom-data polcom-filename)
|
|
|
|
(with-output-to-string (λ() (system (format "chmod 755 ~a" polcom-filename))))
|
|
|
|
(with-output-to-string (λ() (system (format "chmod 755 ~a" polcom-filename))))
|
|
|
|
(message "Setup complete")
|
|
|
|
(message "Setup complete")
|
|
|
|
(message (format "Run './~a start' to start pollen" polcom-filename))
|
|
|
|
(message (format "Run '~a~a start' to start pollen development server" cd polcom-filename))
|
|
|
|
(message (format "Or run './~a help' for a list of commands" polcom-filename))
|
|
|
|
(message (format "Or run '~a~a help' for a list of commands" cd polcom-filename))
|
|
|
|
(exit)))
|
|
|
|
(exit)))
|
|
|
|
(message "No path to racket binary. Aborting setup")))
|
|
|
|
(message "No path to racket binary. Aborting setup")))
|