Skip to content

Commit

Permalink
Add checks for git status to ready_to_release.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwsw committed Feb 10, 2023
1 parent ab33889 commit 68c630c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ready_to_release
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ sub check_files {
if ($ver_version ne $news_version) {
error("$news_file: latest version comparision is for $news_version not $ver_version");
}
my $pull_out = `git pull --dry-run 2>&1 | grep ' ->'`;
if ($pull_out) {
error("git: need to pull");
}
my $stat_out = `git status | grep "Changes not staged for commit:"`;
if ($stat_out) {
error("git: need to commit changes");
}

if ($errors == 0) {
print "$ver_version ready for release\n";
} else {
Expand All @@ -58,7 +67,7 @@ sub read_version_c {
my $fd;
open $fd, '<', $version_c or die "cannot open $version_c: $!";
while (<$fd>) {
if (m|^\s*v([\d.]+)(\s.*)?|) {
if (m|^\s*v([\d.]+)(\s.*)?$|) {
$hi_version = $1;
$2 =~ m|^\s*(\d+)\s*/\s*(\d+)\s*/\s*(\d+)\s|;
($month, $day, $year) = ($1,$2,$3);
Expand Down

0 comments on commit 68c630c

Please sign in to comment.