cupper-hugo-theme/lib/update.js
Heydon Pickering 253a3a97c0 updating script
2017-08-22 09:54:01 +01:00

21 lines
720 B
JavaScript
Executable File

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