-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
30 lines (25 loc) · 954 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
#!/usr/bin/env node
const { Command } = require('commander');
const { version } = require("./package.json");
const { Template } = require("./template");
if (require.main === module) {
const program = new Command();
program.name("fvonts")
.description("Fvonts, Self-host Fonts")
.version(version);
program.command("tmt")
.description("Fvonts Font Template Generator")
.argument("<string>", 'string to template')
.option('--no-css', 'Don\'t touch css file')
.option('-t, --template <directory>', 'Template Directory')
.option('-d, --destination <directory>', 'Destination directory')
.action((str, options) => {
Template.replace({
fontName: str,
noCss: !options.css,
destination: options.destination,
templateFolderPath: options.template
});
})
program.parse(process.argv);
}