cupper-hugo-theme/lib/update.js

21 lines
712 B
JavaScript
Executable File

var exec = require('child_process').exec;
var path = require('path');
var themeFolder = path.join(path.resolve('.'), 'themes');
var oldTheme = path.join(themeFolder, 'cupper');
exec('mv '+oldTheme+' '+oldTheme+'-old-'+Date.now(), function(error, stdout, stderr) {
console.log('Updating...');
if (error !== null) {
console.error('Error saving old cupper version.');
return;
}
exec ('svn export https://github.com/ThePacielloGroup/cupper/trunk/themes/cupper '+oldTheme, function(error, stdout, stderr) {
if (error !== null) {
console.error('SVN error exporting cupper from Github. Is SVN installed?');
return;
}
console.log('Cupper updated to latest version!');
});
});