cupper-hugo-theme/lib/clean.js

24 lines
981 B
JavaScript
Raw Normal View History

2017-09-13 11:14:15 +02:00
var exec = require('child_process').exec;
var path = require('path');
2017-11-02 17:50:47 +01:00
console.log('Initializing new project...');
2017-09-13 11:14:15 +02:00
exec('rm -rf ' + path.join(path.resolve('.'), 'content') + ' && mkdir content && mkdir ' + path.join('content', 'patterns'), function(error, stdout, stderr) {
if (error !== null) {
console.error('Error creating folder structure.');
return;
}
exec ('hugo new ' + path.join('patterns', 'pattern.md') + ' && hugo new _index.md && hugo new print-version.md --kind print-version', function(error, stdout, stderr) {
if (error !== null) {
console.error('Error creating new project files.');
return;
}
2018-08-10 22:12:36 +02:00
exec ('cat ' + path.join('themes', 'cupper', 'clean', 'README_BLANK.md') + ' > README.md', function(error, stdout, stderr) {
2017-09-13 11:14:15 +02:00
if (error !== null) {
console.error('Error initializing README file.');
return;
}
console.log('New project ready. See patterns/pattern.md to get started.');
});
});
});