-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
74 lines (68 loc) · 1.8 KB
/
index.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
71
72
73
74
const inquirer = require("inquirer");
const chalk = require("chalk");
const NodeRSA = require("node-rsa");
const fs = require("fs");
(async () => {
const answers = await inquirer.prompt([
{
type: "input",
name: "name",
message: "Enter your full name",
},
{
type: "input",
name: "street",
message: "Street address",
},
{
type: "input",
name: "street2",
message: "Suite or Apt # (optional)",
},
{
type: "input",
name: "city",
message: "City",
},
{
type: "input",
name: "state",
message: "State/Region",
},
{
type: "input",
name: "zip",
message: "Postal Code",
},
{
type: "input",
name: "country",
message: "Country",
},
{
type: "input",
name: "notes",
message: "Any special notes?",
},
]);
const keyData = fs.readFileSync("public.key", "utf8");
const key = NodeRSA();
key.importKey(keyData);
const encrypted = key.encrypt(answers, "base64");
console.log(chalk.yellow("------ copy below ------"));
console.log(chalk.green(encrypted));
console.log(chalk.yellow("------ copy above ------"));
console.log(`
${chalk.blueBright(
"Step 1:"
)} Copy the green encrypted text above - it's your encrypted mailing address.
${chalk.blueBright("Step 2:")} Create a new file in ${chalk.bgBlue(
"stickers/<your-github-username>.txt"
)}. Paste in the green text.
${chalk.blueBright("Step 3:")} Submit a pull request on Github.
${chalk.blueBright("Step 4:")} Check your mailbox in a few weeks!
${chalk.bgKeyword("orange")(
chalk.black(" Pull Request Requirements ")
)} Your pull request should only contain 1 new file! Which is the stickers/<your-github-username>.txt file.
`);
})();