-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
executable file
·39 lines (33 loc) · 871 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
const SSSSSSSSSSS = require('./src/SSSSSSSSSSS');
const { fileToString, optionsFileInArgs } = require('./src/utils');
const DEFAULT_OPTIONS = {
baseFolder: './example',
outputPath: './docs',
baseUrl: '/',
pageTemplate: 'page.ejs',
baseTemplate: 'base.ejs',
metadata: {
blogTitle: 'Test Blog'
}
};
const generateOptions = async (argv) => {
let optionsFile = optionsFileInArgs([...argv]);
let parsedOptions = {};
try {
if(optionsFile) {
parsedOptions = JSON.parse(await fileToString(optionsFile));
}
} catch {
console.log('unable to find options file, using defaults');
}
return {
...DEFAULT_OPTIONS,
...parsedOptions
}
}
const main = async (argv) => {
const options = await generateOptions([...argv]);
const sssssssssss = new SSSSSSSSSSS(options);
await sssssssssss.generate();
}
module.exports = main;