You can use this technique for local development installs too (that’s its primary purpose).
Why not read the code for that rake task and modify it how you see fit?