-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
47 lines (38 loc) · 1.2 KB
/
index.ts
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
#!/usr/bin/env node
import chalk from 'chalk';
import { Command } from 'commander'; // add this line
import build from './build';
import dev from './dev';
import deploy from './deploy';
import start from './start';
import init from './install';
(async () => {
//add the following line
const program = new Command();
console.log(chalk.whiteBright.bgGreenBright('\n Jakyll.js \n'));
program
.version('0.5.7')
.option('-dev', 'Run the site in development mode with hot reloading')
.option('-build', 'Build a static version of the site and run it in production mode')
.option('-start', 'Run it in production mode')
.option('-deploy', 'Deploys a static production version of the site to gh-pages')
.option('-init', 'Initializes the project adding scripts and creating the folders required')
.parse(process.argv);
const options = program.opts();
if (options.Dev) {
process.env.mode = 'dev';
await dev();
}
if (options.Build) {
await build();
}
if (options.Deploy) {
await deploy();
}
if (options.Start) {
await start();
}
if (options.init) {
await init();
}
})();