use File::Spec;
use File::Find;
use ExtUtils::MakeMaker ();
+use Getopt::Long qw(:config gnu_getopt);
-my $version = $ARGV[0] or die "version required!";
+GetOptions(
+ "branch=s" => \(my $branch = 'master'),
+) or die("Error in command line arguments\n");
+
+my $version = shift or die "version required!";
my $make = $Config{make};
my $null = File::Spec->devnull;
}
for (scalar `git status`) {
- /^(?:# )?On branch master/ || die "Not on master. EEEK";
+ /^(?:# )?On branch \Q$branch\E/ || die "Not on $branch. EEEK";
/Your branch is behind|Your branch and .*? have diverged/ && die "Not synced with upstream";
}
my %vars = (
REMAKE => join(' ', '$(PERLRUN)', 'Makefile.PL', map { $self->quote_literal($_) } @ARGV),
+ BRANCH => $self->{BRANCH} ||= 'master',
);
join('',
<<'END',
preflight:
- $(ABSPERLRUN) Distar/helpers/preflight $(VERSION)
+ $(ABSPERLRUN) Distar/helpers/preflight $(VERSION) --branch=$(BRANCH)
releasetest:
$(MAKE) disttest RELEASE_TESTING=1 PASTHRU="$(PASTHRU) TEST_FILES=\"$(TEST_FILES)\""
release: preflight releasetest