2020-08-04 13:36:48 +00:00
|
|
|
const cpy = require('cpy');
|
|
|
|
|
|
|
|
const {build: buildUserscripts} = require('./userscripts');
|
|
|
|
const {build: buildUserstyles} = require('./userstyles');
|
|
|
|
|
|
|
|
async function main() {
|
|
|
|
console.log('Copying files.');
|
|
|
|
await cpy(
|
|
|
|
[
|
|
|
|
'**',
|
|
|
|
'!index.js',
|
|
|
|
'!userscripts.js',
|
|
|
|
'!userstyles.js',
|
|
|
|
'!userscripts/*',
|
2020-08-13 14:19:43 +00:00
|
|
|
'!userstyles/*',
|
|
|
|
'!scss/*'
|
2020-08-04 13:36:48 +00:00
|
|
|
],
|
|
|
|
'../public/',
|
|
|
|
{
|
|
|
|
cwd: 'source',
|
|
|
|
parents: true
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
await cpy(
|
|
|
|
['node_modules/modern-normalize/modern-normalize.css'],
|
|
|
|
'public/css/'
|
|
|
|
);
|
|
|
|
|
|
|
|
console.log('Building userscripts.');
|
|
|
|
await buildUserscripts();
|
|
|
|
|
|
|
|
console.log('Building userstyles.');
|
|
|
|
await buildUserstyles();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Run `main()` if this script was called directly (like `node source/index.js`).
|
|
|
|
if (require.main === module) {
|
|
|
|
main();
|
|
|
|
}
|