Skip to content

Commit 7ad8aae

Browse files
committed
📦NEW: getting username & password
1 parent 8ab36b1 commit 7ad8aae

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

‎utils/authentication.js‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = async () => {
77
if (auth.Authorization === "") {
88
io.write(
99
red(
10-
"\n> To use the CLI without any issue, first enter your GitHub access token. THIS IS ONE TIME THING.\n"
10+
"\n> This CLI will work best if you enter your GitHub Access Token, Username & Password. THIS IS ONE TIME THING.\n"
1111
)
1212
);
1313
io.write(
@@ -19,10 +19,22 @@ module.exports = async () => {
1919
io.write(yellow("Token: "));
2020
const token = await io.read();
2121

22-
const data = `module.exports = {
22+
const userToken = `module.exports = {
2323
Authorization: "Token ${token}",
24+
}`;
25+
26+
io.write(yellow("GitHub Username: "));
27+
const username = await io.read();
28+
29+
io.write(yellow("GitHub Password: "));
30+
const password = await io.read();
31+
32+
const userData = `module.exports = {
33+
username: "${username}",
34+
password: "${password}",
2435
}`;
2536

26-
fs.writeFile("./utils/auth.js", data, (err) => {});
37+
fs.writeFile("./utils/auth.js", userToken, (err) => {});
38+
fs.writeFile("./utils/user.js", userData, (err) => {});
2739
}
2840
};

0 commit comments

Comments
 (0)