Skip to content

Commit

Permalink
🔀 Merge pull request #1578 from TF2Autobot/fix-updaterepo-cmd
Browse files Browse the repository at this point in the history
Fix `!updaterepo` command
  • Loading branch information
idinium96 authored Jun 23, 2023
2 parents 259f840 + 6bf15ff commit b4c166e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/classes/Commands/sub-classes/Manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ export default class ManagerCommands {
const exec = (command: string): Promise<void> => {
return new Promise((resolve, reject) => {
child.exec(command, { cwd }, err => {
if (err && !['npm run build', 'pm2 restart ecosystem.json'].includes(command)) {
if (err && !['npm run build'].includes(command)) {
// not sure why this error always appeared: https://prnt.sc/9eVBx95h9uT_
log.error(`Error on updaterepo (executing ${command}):`, err);
return reject(err);
Expand Down Expand Up @@ -975,7 +975,7 @@ export default class ManagerCommands {
await exec('npm run build');

this.bot.sendMessage(steamID, '⌛ Restarting...');
await exec('pm2 restart ecosystem.json');
await this.bot.botManager.restartProcess();
} catch (err) {
this.bot.sendMessage(steamID, `❌ Error while updating the bot: ${JSON.stringify(err)}`);
// Bring back to online
Expand Down

0 comments on commit b4c166e

Please sign in to comment.