X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=mig;h=e0a67543823bea3f68d92ead40f419297840c664;hp=b48a76ebf948737fbd23c2e615c989a424144090;hb=bc721db6d7e1f19890d1b4d8ea320bbcba82461a;hpb=e0c288ae409d7b4f6ec493ba976a64294ce8a12c diff --git a/mig b/mig index b48a76e..e0a6754 100755 --- a/mig +++ b/mig @@ -251,16 +251,21 @@ adds an extra arbitrary page of notes to the report. Mig assumes the page file This will define a set of tags to use, if not set it will default to Circs, Holds, Actors, Bibs, Assets & Money. +--debug + +Gives more information about what is happening. + --reports_xml Allows you to override the default evergreen_staged_report.xml in the mig-xml folder. -=item B --pull spreadsheet_tab or --push postgres_table +=item B --pull or --push spreadsheet_tab This uses the gsheet_tracked_table and gsheet_tracked column tables to map a Google Docs Spreadsheet tabs -with Postgres tables in the mig schema. Multiple spreadsheets can be used but tab names must be unique. -Each spreadsheet column needs a header that matches the column name in the matching table. An oauth -session key is also needed for your Google account and mig gsheet will look for it in the .mig directory. +with Postgres tables in the mig schema. The spreadsheet is assumed to share the name as the mig schema. +Tab names must be unique. Each spreadsheet column needs a header that matches the column name in the matching +table. An oauth session key is also needed for your Google account and mig gsheet will look for it in the +.mig directory. =back @@ -294,82 +299,9 @@ switch($ARGV[0]) { pod2usage(-verbose => 2); } } - case "env" { - standard_invocation(@ARGV); - } - case "init" { - Mig::die_if_no_env_migschema(); - standard_invocation(@ARGV); - } - case "status" { - Mig::die_if_no_env_migschema(); - standard_invocation(@ARGV); - } - case "add" { - Mig::die_if_no_env_migschema(); - standard_invocation(@ARGV); - } - case "reporter" { - Mig::die_if_no_env_migschema(); - standard_invocation(@ARGV); - } - case "gsheet" { - Mig::die_if_no_env_migschema(); - standard_invocation(@ARGV); - } - case "remove" { - Mig::die_if_no_env_migschema(); - standard_invocation(@ARGV); - } - case "iconv" { - Mig::die_if_no_env_migschema(); - standard_invocation(@ARGV); - } - case "skip-iconv" { - Mig::die_if_no_env_migschema(); - standard_invocation(@ARGV); - } - case "clean" { - Mig::die_if_no_env_migschema(); - standard_invocation(@ARGV); - } - case "skip-clean" { - Mig::die_if_no_env_migschema(); - standard_invocation(@ARGV); - } - case "link" { - Mig::die_if_no_env_migschema(); - standard_invocation(@ARGV); - } - case "unlink" { - Mig::die_if_no_env_migschema(); - standard_invocation(@ARGV); - } - case "convert" { - Mig::die_if_no_env_migschema(); - standard_invocation(@ARGV); - } - case "stage" { - Mig::die_if_no_env_migschema(); - standard_invocation(@ARGV); - } - case "mapper" { - Mig::die_if_no_env_migschema(); - standard_invocation(@ARGV); - } - case "quicksheet" { - Mig::die_if_no_env_migschema(); - standard_invocation(@ARGV); - } - case "sql" { - Mig::die_if_no_env_migschema(); - standard_invocation(@ARGV); - } case "map" { - Mig::die_if_no_env_migschema(); } case "load" { - Mig::die_if_no_env_migschema(); } case "wdir" { print "$MIGWORKDIR\n"; @@ -381,13 +313,20 @@ switch($ARGV[0]) { print "$MIGGITDIR\n"; } else { - pod2usage(1); + standard_invocation(@ARGV); } } sub standard_invocation { my $cmd = shift; - system( $mig_bin . "mig-$cmd", @_ ); + + if ($cmd ne 'env') { Mig::die_if_no_env_migschema(); } + if (-e $mig_bin . "mig-$cmd") { + system( $mig_bin . "mig-$cmd", @_ ); + } else { + system( "mig-$cmd", @_ ) == 0 or die pod2usage(1); + } + }