Fix gitreset
This commit is contained in:
parent
5feaa89583
commit
a34f08a1a2
1 changed files with 4 additions and 6 deletions
|
@ -9,16 +9,14 @@ module.exports = {
|
||||||
execute({message, client}) {
|
execute({message, client}) {
|
||||||
let cmd = "git reset --hard master";
|
let cmd = "git reset --hard master";
|
||||||
const exec = require("child_process").exec;
|
const exec = require("child_process").exec;
|
||||||
let sendText = "";
|
|
||||||
exec(cmd, (err, stdout, stderr) => {
|
exec(cmd, (err, stdout, stderr) => {
|
||||||
reloadCommands(client);
|
|
||||||
sendText = `${stdout}\nCommands reloaded`;
|
|
||||||
if(err){
|
if(err){
|
||||||
fs.writeFileSync("../../data/log.txt", `${convertDateToISOString(new Date())}\n${stderr}\n`, {flag: 'a'});
|
fs.writeFileSync("../../data/log.txt", `${convertDateToISOString(new Date())}\n${stderr}\n`, {flag: 'a'});
|
||||||
sendText = `Something went wrong, check data/log.txt for more information`;
|
message.channel.send(`Something went wrong, check data/log.txt for more information`);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
reloadCommands(client);
|
||||||
|
message.channel.send(`${stdout}\nCommands reloaded`);
|
||||||
});
|
});
|
||||||
message.channel.send(sendText);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
Loading…
Add table
Reference in a new issue