Skip to content

Commit

Permalink
Added confirmation message about which version to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelMayer committed Dec 24, 2024
1 parent 3a05984 commit 093e915
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions publish_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,18 @@ async function nextVersion(currentVersion) {
console.log(`${currentVersion} => ${bumpedPatch}? ${ACCEPT_HINT}`);
console.log(`${currentVersion} => ${bumpedMinor}? (m)`);
var answer = await question(`${currentVersion} => ${bumpedMajor}? (M)\n`);
var finalVersion = bumpedPatch;
if(ok(answer)) {
return bumpedPatch;
} else if(answer == "m") {
return bumpedMinor;
finalVersion = bumpedMinor;
} else if(answer == "M") {
return bumpedMajor;
finalVersion = bumpedMajor;
} else {
console.log("Publishing script aborted.");
throw ABORTED;
}
console.log("You choose version " + finalVersion);
return finalVersion;
}

async function getLastPreparedTag() {
Expand Down Expand Up @@ -325,7 +327,7 @@ async function Main() {
var useNewVersion = false;
if(await isNewer(packageObj, mostRecentDafnyRelease)) {
if (ok(await question(`There is a new Dafny version available: (${mostRecentDafnyRelease}). Do you want to update it? ${ACCEPT_HINT}`))) {
// We keep that number
console.log(`Updating latest version of Dafny to ${mostRecentDafnyRelease}`);
} else {
console.log("Ignoring new Dafny version.");
mostRecentDafnyRelease = undefined;
Expand Down

0 comments on commit 093e915

Please sign in to comment.