Hi, <br><br>This isn't actually a problem with racket, but just a helpful tip for OS X user who want to use the racket system commands for exectables they have installed themselves. (I found it looking at the documentation for an OS X GIT tool)<br>
<br>My problem was I couldn't get (system command) to call newly installed executables. <br> - adding it to the $PATH doesn't work for OSX (I believe it does work for windows, though I don't know the situation on linux?)<br>
<br>The attached script adds the path /usr/local/fossil/bin to the ~/.MacOSX/environment.plist, making the executables in that folder available to DrRacket, as demonstrated by the keybinding.rkt user-defined-keybindings file attached as a demonstration/test.<br clear="all">
<br>User defined keybindings are a excellent way to extend DrRacket, and this little tip should help any OS X users who want to use them with their own tools. (git?)<br><br>Cheers,<br><br>Stephen<br><br><br>-- <br><br>#!/bin/sh<br>
<br>append_path () {<br> input="$1"<br> value="$2"<br> if ! echo $input | /usr/bin/egrep -q "(^|:)$value($|:)" ; then<br> if [ "$3" = "after" ] ; then<br> echo $input:$value<br>
else<br> echo $value:$input<br> fi<br> else<br> echo $input<br> fi<br>}<br><br>append_plist_var() {<br> name="$1"<br> append_value="$2"<br> default_value="$3"<br> current_value="`defaults read $HOME/.MacOSX/environment ${name}`"<br>
[ ! "$current_value" ] && current_value="$default_value"<br> new_value="`append_path "$current_value" "$append_value" after`"<br> defaults write $HOME/.MacOSX/environment "$name" "$new_value"<br>
if [ "$current_value" == "$new_value" ]; then<br> echo "No change to $name in ~/.MacOSX/environment.plist"<br> else<br> echo "Variable $name in ~/.MacOSX/environment.plist changed from '$current_value' to '$new_value'"<br>
fi<br>}<br><br>append_plist_var PATH "/usr/local/fossil/bin" "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin"<br><br>pushd "$HOME"<br><br>popd<br><br>