improve the wording for the command-line menu item

This commit is contained in:
Robby Findler 2013-11-11 13:07:23 -06:00
parent f8a2c2d28e
commit b17fb32544
2 changed files with 31 additions and 13 deletions

View File

@ -37,6 +37,7 @@
(when bin-dir
(when (file-exists? authopen)
(when (directory-exists? paths.d)
(define paths.d/racket (build-path paths.d "racket"))
(define (add-racket/bin-to-path)
(define sp (open-output-string))
(define succeeded?
@ -45,27 +46,31 @@
(format "~a\n" bin-dir))]
[current-output-port sp]
[current-error-port sp])
(system* authopen "-c" "-w" (path->string
(build-path
paths.d
"racket")))))
(system* authopen "-c" "-w" (path->string paths.d/racket))))
(define output (get-output-string sp))
(define basic-success-message
(format (string-constant added-racket/bin-to-path)
paths.d/racket
bin-dir
paths.d/racket))
(cond
[(and (equal? output "") succeeded?)
(message-box (string-constant drracket)
(string-constant added-racket/bin-to-path))]
basic-success-message)]
[succeeded?
(message-box (string-constant drracket)
(string-append
(string-constant added-racket/bin-to-path)
basic-success-message
"\n\n" output))]
[else
(message-box (string-constant drracket)
(string-append
(string-constant adding-racket/bin-to-path-failed)
(format (string-constant adding-racket/bin-to-path-failed)
(if (equal? output "")
""
(string-append "\n\n" output))))])
(string-append "\n\n" output "\n\n"))
paths.d/racket
bin-dir)))])
(void))
(new menu-item%
[label (string-constant add-racket/bin-to-path)]

View File

@ -1892,7 +1892,20 @@ please adhere to these guidelines:
(use-a-different-racket "Use a different racket")
;; adding racket/bin to the path; only under mac os x
(added-racket/bin-to-path "Added racket/bin to PATH")
(adding-racket/bin-to-path-failed "Attempt to add racket/bin to PATH failed")
(add-racket/bin-to-path "Add racket/bin to PATH") ;; menu item label
; first ~a is filled with either the empty string or an error message from elsewhere
; (bracketed by some newlines to separate it out)
; second ~a is filled with /etc/paths.d/racket (or some other path like it in the future)
; third ~a is filled with the path to the bin directory of the current drracket
(adding-racket/bin-to-path-failed
"Attempt to add racket support to the command line failed.~aSpecifically,"
" could not create \"~a\" with the contents \"~a\".")
; first and third ~a are filled with /etc/paths.d/racket (or some other path like it in the future)
; and the second one is filled with the path to the bin directory that was put into that file.
(added-racket/bin-to-path
"You should now be able to use racket and its tools at the"
" command-line.\n\nThe"
" default PATH has has been configured for all users by adding the file"
" ~a to point to ~a. You can undo this"
" configuration by deleting ~a.")
(add-racket/bin-to-path "Configure Command Line for Racket...") ;; menu item label
)