X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=bin%2Fgenerate-table-module;h=37a581200bc72a894fc65393cfff6c3141acee5d;hp=16a23e5b791fa94978c3ee671bfb9f433d06c2e8;hb=f8bb0d02510a30c7c0c14900c4ffb61431209ac0;hpb=e042c7a9463af50a08cab6ddfcd62fed2b5f276e diff --git a/bin/generate-table-module b/bin/generate-table-module index 16a23e5b7..37a581200 100755 --- a/bin/generate-table-module +++ b/bin/generate-table-module @@ -1,7 +1,11 @@ #!/usr/bin/perl +use strict; +use vars qw( $opt_n ); use FS::Schema qw( dbdef_dist ); +use Getopt::Std; +getopts('n'); my $table = shift; ### @@ -69,12 +73,9 @@ close DEST; # add to FS/FS/Mason.pm ### -# it needs to be: -# 1. disablable (have an option to turn it off) -# 2. documented in the schema change docs -# -#my $magic = '# Sammath Naur'; -#system("perl -pi -e 's/$magic/use FS::$table;\n $magic/' FS/FS/Mason.pm"); +my $magic = '# Sammath Naur'; +system("perl -pi -e 's/$magic/use FS::$table;\n $magic/' FS/FS/Mason.pm") + unless $opt_n; ### # add FS/t/table.t @@ -94,10 +95,10 @@ close TEST; # add them to MANIFEST ### -system('cvs edit FS/MANIFEST'); - open(MANIFEST,">>FS/MANIFEST") or die $!; print MANIFEST "FS/$table.pm\n", "t/$table.t\n"; close MANIFEST; +system("git add FS/FS/$table.pm FS/t/$table.t"); +