Skip to content

Commit d11a05f

Browse files
committed
📦NEW: exit
1 parent ec3d4d8 commit d11a05f

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed

utils/createIssue.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const io = require("console-read-write");
1010
const { cyan, green } = require("chalk");
1111
const axios = require("axios");
1212
const box = require("./box.js");
13+
const exit = require("./exit.js");
1314
let headers;
1415
try {
1516
headers = require(`${pwd}/auth.js`);
@@ -53,11 +54,13 @@ module.exports = async () => {
5354
box(name, msg);
5455

5556
io.write("");
56-
io.write(green(`Issue Link -> ${res.data.html_url}\n`));
57+
io.write(green(`Issue Link -> ${res.data.html_url}`));
58+
exit();
5759
})
5860
.catch((err) => {
5961
const name = "⚠️ WARNING";
6062
const msg = "Issue Creation Failed!!";
6163
box(name, msg);
64+
exit();
6265
});
6366
};

utils/createRepo.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const io = require("console-read-write");
1010
const { cyan, green } = require("chalk");
1111
const axios = require("axios");
1212
const box = require("./box.js");
13+
const exit = require("./exit.js");
1314
let headers;
1415
try {
1516
headers = require(`${pwd}/auth.js`);
@@ -63,11 +64,13 @@ module.exports = async () => {
6364
const msg = "Repo Successfully Created!!";
6465
box(name, msg);
6566
io.write("");
66-
io.write(green(`Repo Link -> ${res.data.html_url}\n`));
67+
io.write(green(`Repo Link -> ${res.data.html_url}`));
68+
exit();
6769
})
6870
.catch((err) => {
6971
const name = "⚠️ WARNING";
7072
const msg = "Repo Creation Failed!!";
7173
box(name, msg);
74+
exit();
7275
});
7376
};

utils/getEmail.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const io = require("console-read-write");
1010
const { cyan } = require("chalk");
1111
const axios = require("axios");
1212
const box = require("./box.js");
13+
const exit = require("./exit.js");
1314
let headers;
1415
try {
1516
headers = require(`${pwd}/auth.js`);
@@ -27,20 +28,23 @@ module.exports = async () => {
2728
.then((res) => {
2829
for (let i = 0; i < res.data.length; i++) {
2930
if (res.data[i].type === "PushEvent") {
30-
const name = "✉️ EMAIL";
31+
const name = "✉️ EMAIL";
3132
box(name, res.data[i].payload.commits[0].author.email);
33+
exit();
3234
break;
3335
}
3436
if (i === res.data.length - 1) {
3537
const name = "⚠️ WARNING";
3638
const msg = "No Email Found!!";
3739
box(name, msg);
40+
exit();
3841
}
3942
}
4043
})
4144
.catch((err) => {
4245
const name = "⚠️ WARNING";
4346
const msg = "Cannot Access Email!!";
4447
box(name, msg);
48+
exit();
4549
});
4650
};

utils/getRepo.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const io = require("console-read-write");
1010
const { cyan } = require("chalk");
1111
const axios = require("axios");
1212
const box = require("./box.js");
13-
const table = require("./repoOutput.js");
13+
const display = require("./repoOutput.js");
1414
const clear = require("clear");
1515
const exit = require("./exit");
1616

@@ -38,7 +38,7 @@ module.exports = async () => {
3838
io.write("");
3939

4040
for (let i = 0; i < res.data.length; i++) {
41-
table(
41+
display(
4242
i + 1,
4343
res.data[i].name,
4444
res.data[i].fork,
@@ -52,10 +52,9 @@ module.exports = async () => {
5252
exit();
5353
})
5454
.catch((err) => {
55-
console.log(err);
56-
5755
const name = "⚠️ WARNING";
5856
const msg = "Couldn't Get Repos!!";
5957
box(name, msg);
58+
exit();
6059
});
6160
};

utils/getStargazer.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const io = require("console-read-write");
1010
const { cyan } = require("chalk");
1111
const axios = require("axios");
1212
const box = require("./box.js");
13+
const exit = require("./exit.js");
1314
let headers;
1415
try {
1516
headers = require(`${pwd}/auth.js`);
@@ -32,10 +33,12 @@ module.exports = async () => {
3233
const name = "⭐️ STARS";
3334
const data = res.data.stargazers_count;
3435
box(name, data);
36+
exit();
3537
})
3638
.catch((err) => {
3739
const name = "⚠️ WARNING";
3840
const msg = "Cannot Access Stars!!";
3941
box(name, msg);
42+
exit();
4043
});
4144
};

0 commit comments

Comments
 (0)