-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.js
40 lines (32 loc) · 811 Bytes
/
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
"use strict";
const fs = require("fs-extra");
const chalk = require("chalk");
const boxen = require("boxen");
const themeQuestions = require("./lib/question");
const renameTheme = require("./lib/replace");
//let ignoreFile = "style.css";
module.exports = async (config, ignoreFile = "**/*.ignore") => {
// cli Intro
console.log(
boxen(
chalk`
It starts with
{bold.hex("#3d627d") ${require(config).from.Name}}
`,
{
padding: 1,
margin: 1,
borderStyle: "round",
float: "center",
align: "center"
}
)
);
// Ask questions and save answers
console.log(chalk.yellow.bold("Make it Yours\n"));
await themeQuestions(config);
// find and replace
let newConf = await fs.readJson(config);
console.log(chalk.red("\nReplacing..."));
await renameTheme(newConf, ignoreFile);
};