Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix !updaterepo command #1578

Merged
merged 2 commits into from
Jun 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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