Skip to content

Commit

Permalink
Updating compare_versions
Browse files Browse the repository at this point in the history
  • Loading branch information
schuemie committed Aug 23, 2024
1 parent 2dd0c3a commit 1100086
Showing 1 changed file with 3 additions and 28 deletions.
31 changes: 3 additions & 28 deletions compare_versions
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ $r_major = $1;
$r_minor = $2;
$r_mod = $3;

print "New R version: $r_major-$r_minor-$r_mod\n";

open(GIT_VERSION, "git describe --tags |");
$git = <GIT_VERSION>;
close(GIT_VERSION);
Expand All @@ -20,33 +18,10 @@ $git_major = $1;
$git_minor = $2;
$git_mod = $3;

print "Current git version: $git_major-$git_minor-$git_mod\n";

if ($r_major > $git_major || $r_minor > $git_minor || $r_mod > $git_mod) {
$monotonic = 0;
$new_version = "v$r_major.$r_minor.$r_mod";
} else {
$monotonic = -1;
}

if ($monotonic != 0) {
print "Non-monotonically increasing versions numbers\n";
}

if ($monotonic == 0 & $ARGV[0] eq "--tag") {

$cmd = "git config user.name \"Martijn Schuemie\"; " .
"git config user.email \"schuemie@ohdsi.org\"; " .
"git tag v$r_major.$r_minor.$r_mod ; " .
"git push -q https://\$GH_TOKEN\@github.com/\$GITHUB_REPOSITORY.git --tags";

print "cmd: $cmd\n";

open(GIT_PUSH, "$cmd |");
while ($line = <GIT_PUSH>) {
print "push: $line";
} # TODO Check for errors
close(GIT_PUSH);
print "push: END\n\n";
$new_version = "";
}

exit($monotonic);
print($new_version);

0 comments on commit 1100086

Please sign in to comment.