forked from Supositware/Haha-Yes
update from git without having to ssh to the server
This commit is contained in:
parent
055035f01d
commit
7df050e5a3
1 changed files with 29 additions and 0 deletions
29
commands/owner/update.js
Normal file
29
commands/owner/update.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
const util = require('util');
|
||||
const exec = util.promisify(require('child_process').exec);
|
||||
|
||||
class EvalCommand extends Command {
|
||||
constructor() {
|
||||
super('update', {
|
||||
aliases: ['update'],
|
||||
category: 'owner',
|
||||
ownerOnly: 'true',
|
||||
description: {
|
||||
content: 'Update the bot with git pull',
|
||||
usage: '',
|
||||
examples: ['']
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message) {
|
||||
async function update() {
|
||||
const { stdout, stderr } = await exec('git pull');
|
||||
message.channel.send(stdout);
|
||||
message.channel.send(stderr);
|
||||
}
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = EvalCommand;
|
Loading…
Reference in a new issue