fix(cli): remove dup. message if already enhanced

This commit is contained in:
dragonwocky 2024-04-21 17:01:30 +10:00
parent 9b03b1d9f7
commit 3d7efbef54
Signed by: dragonwocky
GPG Key ID: 7998D08F7D7BD7A8

27
bin.mjs
View File

@ -252,21 +252,18 @@ try {
}
},
compareVersions = async () => {
if (insertVersion === manifest.version) {
// same version already applied
print` {grey * ${messages["notion-found"]}}\n`;
return SUCCESS;
} else if (insertVersion) {
// diff version already applied
print` {grey * ${messages["notion-found"]}}\n`;
const replace = await promptConfirmation(messages["update-confirm"]);
print`\n`;
return ["Y", "y"].includes(replace)
? (await interactiveRestore()) === SUCCESS
? INCOMPLETE
: FAILURE
: CANCELLED;
} else return INCOMPLETE;
if (!insertVersion) return INCOMPLETE;
// same version already applied
if (insertVersion === manifest.version) return SUCCESS;
// diff version already applied
print` {grey * ${messages["notion-found"]}}\n`;
const replace = await promptConfirmation(messages["update-confirm"]);
print`\n`;
return ["Y", "y"].includes(replace)
? (await interactiveRestore()) === SUCCESS
? INCOMPLETE
: FAILURE
: CANCELLED;
},
interactiveEnhance = async () => {
if (!args["--no-backup"]) {