Created
March 3, 2011 15:09
-
-
Save ianterrell/852892 to your computer and use it in GitHub Desktop.
Small script to
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Usage: | |
# gitdb copy | |
# Copies the current development database into db/branchname-development.sqlite3 | |
# gitdb | |
# Copies the db/branchname-development.sqlite3 into the default db/development.sqlite3 | |
branch = `git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'`.gsub('* ','').strip | |
if ARGV[0] == "copy" | |
`cp db/development.sqlite3 db/#{branch}-development.sqlite3` | |
else | |
`cp db/#{branch}-development.sqlite3 db/development.sqlite3` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment