Skip to content

Commit 2103443

Browse files
committed
📦 NEW: username
1 parent dd5c842 commit 2103443

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

‎utils/authentication.js‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ try {
99
module.exports = async () => {
1010
io.write(
1111
red(
12-
"\n> This CLI will work best if you enter your GitHub Access Token. THIS IS ONE TIME THINGY.\n"
12+
"\n> This CLI will work best if you enter your GitHub Access Token & Username. THIS IS ONE TIME THINGY.\n"
1313
)
1414
);
1515
io.write(
@@ -20,13 +20,25 @@ try {
2020

2121
io.write(yellow("Token: "));
2222
const token = await io.read();
23+
io.write("");
24+
io.write(yellow("Username: "));
25+
const username = await io.read();
2326

2427
const userToken = `module.exports = {
2528
Authorization: "Token ${token}",
2629
}`;
2730

31+
const userName = `module.exports = {
32+
username: "${username}",
33+
}`;
34+
2835
fs.writeFile(`./auth.js`, userToken, (err) => {});
29-
io.write(green("\n> Kindly restart the CLI now to ensure that everyone is working perfectly. You can do by selecting exit option.\n"))
30-
io.write(red("> THIS IS ONE TIME THINGY."))
36+
fs.writeFile(`./user.js`, userName, (err) => {});
37+
io.write(
38+
green(
39+
"\n> Kindly restart the CLI now to ensure that everyone is working perfectly. You can do by selecting exit option.\n"
40+
)
41+
);
42+
io.write(red("> THIS IS ONE TIME THINGY."));
3143
};
3244
}

‎utils/options.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
const io = require("console-read-write");
2+
const chalk = require("chalk");
23
const email = require("./getEmail.js");
34
const stars = require("./getStargazer.js");
45
const exit = require("./exit.js");
56
const issue = require("./createIssue.js");
67
const repo = require("./createRepo.js");
7-
const chalk = require("chalk");
88

99
module.exports = async () => {
1010
io.write(

0 commit comments

Comments
 (0)