-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
executable file
·42 lines (36 loc) · 947 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
41
42
#!/usr/bin/env node
const fs = require('fs-extra')
const { program } = require('commander')
const lib = require('./lib/lib')
program.parse(process.argv)
console.log('')
var options = {
publicFolder: './public',
pagesFolder: './pages',
siteFolder: './_site',
templateFolder: __dirname + '/templates/textbase',
minify: false,
dev: false,
port: 0,
showExtensions: false,
}
var optionsFile = process.cwd() + '/_textbase.js'
fs.exists(optionsFile, (exists) => {
if (exists) options = { ...options, ...require(optionsFile) }
global.options = options
switch (program.args[0]) {
case 'eject':
lib.eject()
break
case 'build':
lib.build()
break
case 'start':
lib.start()
break
default:
global.options = { ...global.options, ...{ dev: true } }
lib.dev()
break
}
})