-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitUpdate.js
More file actions
63 lines (52 loc) · 1.79 KB
/
Copy pathgitUpdate.js
File metadata and controls
63 lines (52 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// import { exec } from "child_process";
// import { pathToFileURL } from "url";
// const config = require('dotenv').config();
// // should keep the bot updated with the git repo
// // will add into commands folder when work is done so it doesn't cause an issue with current command loading on boot
// // need in config: Git username, password, repo URL
// // git info now added to config, testing variables
// // 12/12: git config credentials updated
// const {
// exec
// } = require('child_process');
// const path = require('path');
// const {
// URL
// } = require('url');
// const {
// run: reboot
// } = require('./reboot');
// // possibly separate config for this file
// exports.run = async(client, message, args) => {
// // add git config info
// const gitURL = new URL(config.gitURL);
// gitURL.password = config.gitPass;
// gitURL.username = config.gitHandle;
// exec(`git pull ${gitURL}`, {
// cwd: pathToFileURL.join(__dirname, '../')
// }, async(err, stdout, stderr) => {
// if(err) {
// return console.error(err);
// }
// const out = [];
// if(stdout) {
// out.push(stdout);
// }
// if(stderr) {
// out.push(stderr);
// }
// await message.channel.sendMessage(`\`\`\`${out.join('```\n```')}\`\`\``);
// return reboot(client, message, args);
// });
// };
// exports.conf = {
// enabled: true,
// guildOnly: false,
// aliases: [],
// permLevel: 5
// };
// exports.help = {
// name: 'gitUpdate',
// description: 'Updates bot from Git repo. Only usable by bot creator.',
// usage: 'gitUpdate'
// };