How to Keep a Stable Chandler Around While Developing
I found that dogfooding Chandler was very difficult because often when I updated my development environment, there was a schema change, which necessitated running Chandler with the
--create flag to wipe out the previous repository ("repo").
The thought occurred pretty quickly that it would make life much easier if I could have a "stable" Chandler installed in the proper place (/Applications), which would use its own repo.
However, I didn't get around to trying it until today.
The following replacement for Contents/MacOS/ChandlerApp will cause Chandler to use this repo directory:
-
Library/Application Support/Open Source Applications Foundation/Chandler/released
Note that the directory will have to be created before Chandler will be able to use it.
(I think Chandler should create the repo directory if it doesn't exist, personally.)
The two main changes to the script are: the first two lines, which let me run the script repeatedly from the command line,
and the last line, which specifies an alternate repo directory using the
--profileDir flag.
Both changes are in green.
#!/bin/sh
cd $(dirname "${0}")
execdir=$PWD
executable="${execdir}/python"
resdir=$(dirname "${execdir}")/Resources
main="${resdir}/Chandler.py"
DYLD_LIBRARY_PATH="$resdir/lib"
export DYLD_LIBRARY_PATH
DYLD_FRAMEWORK_PATH="$resdir/Library/Frameworks"
export DYLD_FRAMEWORK_PATH
PYTHONPATH="$resdir"
export PYTHONPATH
PYTHONHOME="$resdir/Library/Frameworks/Python.framework/Versions/2.4"
export PYTHONHOME
cd ${resdir}
exec "${executable}" -O "${main}" --profileDir "${HOME}/Library/Application Support/Open Source Applications Foundation/Chandler/released" "$@"
Update
Instead of "released" I should probably use a version number like "rel0.6.1"; that way I can keep multiple installed versions and still run them all.
Good for regression testing!