mietek/haskell-on-heroku — pull request #9 by rehno-lindeque (2014-06-12 21:15:14+00:00)
Title: Run a custom prepare script included in the app

I quickly hacked this together in order to help me get past #3 quickly. I suspect you probably have something more elegant in mind @mietek, but I thought I'd share it for now.

It sources a custom prepare script included with the app under `deploy/prepare.sh`. I'm using this to add additional sources to the sandbox. E.g. to get around the issue with `persistent-mysql` depending on `libpcre`:

```
function custom_prepare () {
expect_vars HALCYON_DIR

local sandbox_dir
expect_args sandbox_dir -- "$@"

local cwd
cwd=`pwd`

log 'Install custom mysql-simple (avoid installing libpcre)'
git clone https://github.com/rehno-lindeque/mysql-simple.git -b remove-pcre
cd ${sandbox_dir}
cabal sandbox add-source "${cwd}/mysql-simple"
log_end 'done'
}
```