-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
26 lines (23 loc) · 814 Bytes
/
main.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
// main.js
import findConfigFiles from './scripts/findConfigFiles.js';
import handleConfigFile from './scripts/handleConfigFile.js';
import runSharp from './scripts/runSharp.js'
import createPug from './scripts/createPug.js';
// Main function
async function pugsharp() {
// Find all config files
const configPaths = await findConfigFiles();
// Use the configs to create images and pug files
for (const configPath of configPaths) {
// Read, validate and merge the config files
const config = await handleConfigFile(configPath);
// Create the images
await runSharp(config, configPath);
// Create the pug files
await createPug(config, configPath);
}
// All done
console.log('pugsharp finished.')
return true
}
export default pugsharp;