Skip to content

Commit f16399a

Browse files
committed
Improved update dialogs
1 parent ac9f122 commit f16399a

File tree

6 files changed

+28
-17
lines changed

6 files changed

+28
-17
lines changed

lib/menus/update.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,8 @@ export default async (beforeError, forceUpdate) => {
154154
process.stdout.write('\u001b[2J\u001b[0;0H');
155155
await splashLogo(client.locale.lib.loaders.splashLogo);
156156

157-
// Shows a message indicating that the bot is checking for updates
158-
console.log(`🔄 ${await client.functions.utils.parseLocale(locale.updatingFromTo, { originVersion: `v${latestLocalTag}`, targetVersion: `v${latestRemoteTag}` })} ...`);
159-
160-
// Simulates a loading time
161-
await new Promise(resolve => setTimeout(resolve, 3000)); // Espera de 3 segundos
157+
// Shows a message indicating that the bot is downloading the new version
158+
console.log(`⬇️ ${await client.functions.utils.parseLocale(locale.downloadingNewVersion, { targetVersion: `v${latestRemoteTag}`, repositoryURL: packageConfig.repository.url })} ...`);
162159

163160
// Ignores the config.json file
164161
await git.raw(['update-index', '--skip-worktree', 'config.json']);
@@ -169,12 +166,21 @@ export default async (beforeError, forceUpdate) => {
169166
// Makes a checkout to the latest tag
170167
//await git.checkout(latestTag);
171168

169+
// Simulates a loading time
170+
await new Promise(resolve => setTimeout(resolve, 3000));
171+
172+
// Shows a message indicating that the bot is migrating the database and the configuration files
173+
console.log(`🔄 ${locale.migrating} ...`);
174+
175+
// Simulates a loading time
176+
await new Promise(resolve => setTimeout(resolve, 3000));
177+
172178
// Cleans the console and shows the logo
173179
process.stdout.write('\u001b[2J\u001b[0;0H');
174180
await splashLogo(client.locale.lib.loaders.splashLogo);
175181

176182
// Shows a message indicating that the bot has been updated
177-
console.log(` ${await client.functions.utils.parseLocale(locale.updatedCorrectly, { targetVersion: `v${latestRemoteTag}` })}\n`);
183+
console.log(`🎉 ${await client.functions.utils.parseLocale(locale.updatedCorrectly, { targetVersion: `v${latestRemoteTag}` })}\n`);
178184
};
179185

180186
// Shows a message indicating that there are new updates
@@ -250,7 +256,7 @@ export default async (beforeError, forceUpdate) => {
250256
await splashLogo(client.locale.lib.loaders.splashLogo);
251257

252258
// Shows a message indicating that there are new updates
253-
console.log(`⬇️ ${await client.functions.utils.parseLocale(locale.newVersionAvailable, { targetVersion: latestRemoteTag })}\n`);
259+
console.log(`🆕 ${await client.functions.utils.parseLocale(locale.newVersionAvailable, { targetVersion: latestRemoteTag })}\n`);
254260

255261
// Uses a regular expression to obtain the owner and repository name from the URL
256262
const repositoryMetadata = packageConfig.repository.url.match(/github\.com\/([^\/]+)\/([^\/]+)\.git/);

locales/en-US.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,6 @@
13561356
},
13571357
"errorMessage": "An unexpected error ocurred. Check the logs for more details",
13581358
"checkingForUpdates": "Checking if there are new updates",
1359-
"updatingFromTo": "Updating the bot from {{originVersion}} to {{targetVersion}}",
13601359
"updatedCorrectly": "The bot has been correctly updated to {{targetVersion}}",
13611360
"noReleaseNotes": "There are no release notes available for this version",
13621361
"newVersionAvailable": "Version {{targetVersion}} is available!",
@@ -1367,7 +1366,9 @@
13671366
"yes": "Yes",
13681367
"no": "No"
13691368
},
1370-
"alreadyUpdated": "The bot is already updated to the latest version"
1369+
"alreadyUpdated": "The bot is already updated to the latest version",
1370+
"downloadingNewVersion": "Downloading {{targetVersion}} from {{repositoryURL}}",
1371+
"migrating": "Migrating the databases and the configuration files"
13711372
},
13721373
"main": {
13731374
"promptMessage": "Select an option",

locales/es-ES.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,6 @@
13391339
},
13401340
"errorMessage": "An unexpected error ocurred. Check the logs for more details",
13411341
"checkingForUpdates": "Checking if there are new updates",
1342-
"updatingFromTo": "Updating the bot from {{originVersion}} to {{targetVersion}}",
13431342
"updatedCorrectly": "The bot has been correctly updated to {{targetVersion}}",
13441343
"noReleaseNotes": "There are no release notes available for this version",
13451344
"newVersionAvailable": "Version {{targetVersion}} is available!",
@@ -1350,7 +1349,9 @@
13501349
"yes": "Yes",
13511350
"no": "No"
13521351
},
1353-
"alreadyUpdated": "The bot is already updated to the latest version"
1352+
"alreadyUpdated": "The bot is already updated to the latest version",
1353+
"downloadingNewVersion": "Downloading {{targetVersion}} from {{repositoryURL}}",
1354+
"migrating": "Migrating the databases and the configuration files"
13541355
},
13551356
"main": {
13561357
"promptMessage": "Select an option",

locales/it.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,6 @@
13401340
},
13411341
"errorMessage": "An unexpected error ocurred. Check the logs for more details",
13421342
"checkingForUpdates": "Checking if there are new updates",
1343-
"updatingFromTo": "Updating the bot from {{originVersion}} to {{targetVersion}}",
13441343
"updatedCorrectly": "The bot has been correctly updated to {{targetVersion}}",
13451344
"noReleaseNotes": "There are no release notes available for this version",
13461345
"newVersionAvailable": "Version {{targetVersion}} is available!",
@@ -1351,7 +1350,9 @@
13511350
"yes": "Yes",
13521351
"no": "No"
13531352
},
1354-
"alreadyUpdated": "The bot is already updated to the latest version"
1353+
"alreadyUpdated": "The bot is already updated to the latest version",
1354+
"downloadingNewVersion": "Downloading {{targetVersion}} from {{repositoryURL}}",
1355+
"migrating": "Migrating the databases and the configuration files"
13551356
},
13561357
"main": {
13571358
"promptMessage": "Select an option",

locales/ro.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,6 @@
13401340
},
13411341
"errorMessage": "An unexpected error ocurred. Check the logs for more details",
13421342
"checkingForUpdates": "Checking if there are new updates",
1343-
"updatingFromTo": "Updating the bot from {{originVersion}} to {{targetVersion}}",
13441343
"updatedCorrectly": "The bot has been correctly updated to {{targetVersion}}",
13451344
"noReleaseNotes": "There are no release notes available for this version",
13461345
"newVersionAvailable": "Version {{targetVersion}} is available!",
@@ -1351,7 +1350,9 @@
13511350
"yes": "Yes",
13521351
"no": "No"
13531352
},
1354-
"alreadyUpdated": "The bot is already updated to the latest version"
1353+
"alreadyUpdated": "The bot is already updated to the latest version",
1354+
"downloadingNewVersion": "Downloading {{targetVersion}} from {{repositoryURL}}",
1355+
"migrating": "Migrating the databases and the configuration files"
13551356
},
13561357
"main": {
13571358
"promptMessage": "Select an option",

locales/zh-CN.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,6 @@
13401340
},
13411341
"errorMessage": "An unexpected error ocurred. Check the logs for more details",
13421342
"checkingForUpdates": "Checking if there are new updates",
1343-
"updatingFromTo": "Updating the bot from {{originVersion}} to {{targetVersion}}",
13441343
"updatedCorrectly": "The bot has been correctly updated to {{targetVersion}}",
13451344
"noReleaseNotes": "There are no release notes available for this version",
13461345
"newVersionAvailable": "Version {{targetVersion}} is available!",
@@ -1351,7 +1350,9 @@
13511350
"yes": "Yes",
13521351
"no": "No"
13531352
},
1354-
"alreadyUpdated": "The bot is already updated to the latest version"
1353+
"alreadyUpdated": "The bot is already updated to the latest version",
1354+
"downloadingNewVersion": "Downloading {{targetVersion}} from {{repositoryURL}}",
1355+
"migrating": "Migrating the databases and the configuration files"
13551356
},
13561357
"main": {
13571358
"promptMessage": "Select an option",

0 commit comments

Comments
 (0)