Skip to content

Commit

Permalink
The is-script argument to generate-file-with-expressions was only use…
Browse files Browse the repository at this point in the history
…d to make the 'generate' script, which wasn't actually used. So this removes all that to simplify the code.
  • Loading branch information
rob7hunter committed Nov 28, 2008
1 parent ed804ec commit 4b03b33
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions generate-lib.scm
Expand Up @@ -52,7 +52,6 @@
(generate-file-with-expressions
#:dir-must-exist #t
(build-path project-path "serve.scm")
#f
`(require ,(expr-for-lp-require "leftparen.scm")
"app.scm"
"main.scm")
Expand All @@ -69,7 +68,6 @@
(generate-file-with-expressions
#:dir-must-exist #t
(build-path project-path "app.scm")
#f
(make-raw "#lang scheme/base\n")
`(require ,(expr-for-lp-require "leftparen.scm"))
(make-raw "")
Expand All @@ -81,7 +79,6 @@
(generate-file-with-expressions
#:dir-must-exist #t
(build-path project-path "main.scm")
#f
(make-raw "#lang scheme/base\n")
`(require ,(expr-for-lp-require "leftparen.scm")
"app.scm")
Expand All @@ -94,7 +91,6 @@
(generate-file-with-expressions
#:dir-must-exist #t
(build-path project-path "settings-localhost.scm")
#f
`(require ,(expr-for-lp-require "settings.scm"))
(make-raw "")
'(setting-set! *PORT* 8765)
Expand All @@ -110,28 +106,19 @@
;; script/server
(generate-file-with-expressions
(build-path project-path "script/server")
#f
(make-raw "mzscheme -r serve.scm $1"))

;; script/generate
(generate-file-with-expressions
(build-path project-path "script/generate")
#t
`(require ,(expr-for-lp-require "generate-lib.scm"))
`(generate-from-path "." (current-command-line-arguments)))

)

(define-struct raw (str))

(define (generate-file-with-expressions path-to-file is-script
(define (generate-file-with-expressions path-to-file
#:dir-must-exist (dir-must-exist #f)
. expressions)
(with-output-to-file-in-dir
#:must-previously-exist dir-must-exist
path-to-file
(lambda ()
(when is-script (write-string "\":\"; exec mzscheme -r $0 \"$@\"\n"))
(for-each (lambda (e)
(if (raw? e) (write-string (raw-str e)) (write e))
(write-string "\n")) expressions)
Expand Down

0 comments on commit 4b03b33

Please sign in to comment.