-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.js
34 lines (25 loc) · 791 Bytes
/
build.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
const boxen = require("boxen");
const fs = require("fs");
const path = require("path");
const handle = "HormCodes";
const text = `Matěj 'Horm' Horák / @${handle}
Backend Developer at Airthings
https://horm.codes
twitter.com/${handle}
github.com/${handle}
linkedin.com/in/${handle}`;
const output = boxen(text, {
padding: 1,
margin: 1,
borderStyle: "round",
borderColor: "#F26C4F",
});
const cli = `#!/usr/bin/env node
console.log(\`${output}\`);`;
const outputDirectoryName = "bin";
const buildOutputDirectory = path.join(__dirname, outputDirectoryName);
if (fs.existsSync(buildOutputDirectory)) {
fs.rmSync(buildOutputDirectory, { recursive: true });
}
fs.mkdirSync(buildOutputDirectory);
fs.writeFileSync(path.join(__dirname, outputDirectoryName + "/index.js"), cli);