Skip to content

Instantly share code, notes, and snippets.

@nbrew
Created May 6, 2011 22:21
Show Gist options
  • Save nbrew/959905 to your computer and use it in GitHub Desktop.
Save nbrew/959905 to your computer and use it in GitHub Desktop.
Capture migration file name after script/generate migration
echo "exists db/migrate
create db/migrate/20110506220427_add_shared_column_to_resources.rb
"| head -n 2 | tail -n 1 | sed -e 's/.*create[[:space:]]*\(db\/migrate\)/\1/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment