-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpush.js
70 lines (67 loc) · 1.5 KB
/
push.js
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
64
65
66
67
68
69
70
// @ts-ignore
const { exec } = require("child_process"); /* eslint-disable-line */
const { promisify } = require("util"); /* eslint-disable-line */
const rand = arr => arr[Math.floor(Math.random() * arr.length)];
const pushes = [
"Making profit",
"Edited government secret codes",
"Did mystical things",
"Caused the great depression",
"Drarnk ttoo muuch alchhohocalfids-';.;[04;362[7",
"Detonated a mountain",
"HELP YAM IS KIDNAPPING ME GO TO IE)*&@Wdachsp9t32fwsa",
"Asserted that 1 == 1",
"Flexing my spaghetti code",
"Murdered a murder murderer",
"What's this? An error!",
"@everyone lol",
"I got the features in the back"
];
const prefix = [
"Fixed",
"Made",
"Vaccinated",
"Killed",
"Deleted",
"Bullied",
"Composted",
"Created",
"Arrested",
"Added",
"Assaulted",
"Harassed",
"Cooked",
"Removed",
"Ate",
"Drank"
];
const suffix = [
"some bugs",
"mystic",
"gagi",
"a yam",
"a cupcake",
"an olive",
"a speeding gagi",
"new features",
"some mustard",
"a command",
"some secret sauce",
"spaghetti",
"minecraft",
"some mystic dough"
];
(async() => {
let arg = process.argv.slice(2).join(" ");
if (!arg) arg = !Math.floor(Math.random() * 5) ? rand(pushes) : `${rand(prefix)} ${rand(suffix)}`;
console.log(`Pushing...`);
const functions = ["git add -A", `git commit -m "${arg}"`, "git pull", "git push"];
for (const f of functions) {
try {
const res = await promisify(exec)(f);
console.log(res.stdout || res.stderr);
} catch (err) {
console.log(err.stderr);
}
}
})();