@biffo/cli 0.184.4 → 0.184.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +13 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -163,8 +163,18 @@ function planCoreVersionCleanup(cwd) {
|
|
|
163
163
|
if (authority !== null && coreVersionsEqual(found, authority)) {
|
|
164
164
|
return { path, action: "delete", found };
|
|
165
165
|
}
|
|
166
|
+
if (authority !== null && isStaleFossil(found, authority)) {
|
|
167
|
+
return { path, action: "delete", found, stale: true };
|
|
168
|
+
}
|
|
166
169
|
return { path, action: "keep", found, reason: "repurposed" };
|
|
167
170
|
}
|
|
171
|
+
function isStaleFossil(found, authority) {
|
|
172
|
+
try {
|
|
173
|
+
return compareCoreVersions(found, authority) === -1;
|
|
174
|
+
} catch {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
168
178
|
function coreVersionsEqual(a, b) {
|
|
169
179
|
try {
|
|
170
180
|
return compareCoreVersions(a, b) === 0;
|
|
@@ -2913,7 +2923,7 @@ async function applyAndOpenPr(options, deps, plan, migrations, fromVersion, toVe
|
|
|
2913
2923
|
if (cleanedCoreVersion && existsSync11(coreVersionCleanup.path)) {
|
|
2914
2924
|
rmSync5(coreVersionCleanup.path);
|
|
2915
2925
|
log.info(
|
|
2916
|
-
`Deleted orphaned ${CORE_VERSION_FILE} (inherited copy recording ${coreVersionCleanup.found}, superseded by biffo.core.json) \u2014 nothing reads it as an authority (#434).`
|
|
2926
|
+
coreVersionCleanup.stale ? `Deleted stale ${CORE_VERSION_FILE} (recorded ${coreVersionCleanup.found}, behind the version biffo.core.json records \u2014 this instance has moved past it) (#842).` : `Deleted orphaned ${CORE_VERSION_FILE} (inherited copy recording ${coreVersionCleanup.found}, superseded by biffo.core.json) \u2014 nothing reads it as an authority (#434).`
|
|
2917
2927
|
);
|
|
2918
2928
|
}
|
|
2919
2929
|
log.step(
|
|
@@ -3163,8 +3173,9 @@ function printCoreVersionCleanup(cleanup, applying) {
|
|
|
3163
3173
|
if (cleanup === null) return;
|
|
3164
3174
|
if (cleanup.action === "delete") {
|
|
3165
3175
|
const verb = applying ? "delete" : "will delete";
|
|
3176
|
+
const why2 = cleanup.stale ? `stale: records ${cleanup.found}, which this instance has already moved past` : `orphaned inherited copy recording ${cleanup.found}`;
|
|
3166
3177
|
console.log(
|
|
3167
|
-
` ${chalk4.red("cleanup".padEnd(15))} ${CORE_VERSION_FILE} ` + chalk4.dim(`(
|
|
3178
|
+
` ${chalk4.red("cleanup".padEnd(15))} ${CORE_VERSION_FILE} ` + chalk4.dim(`(${why2}) \u2014 ${verb}`)
|
|
3168
3179
|
);
|
|
3169
3180
|
return;
|
|
3170
3181
|
}
|