hexo.init().then(function(){ hexo.call('server', {p:80}).then(function(){ return hexo.exit(); }).catch(function(err){ return hexo.exit(err); }); });
hexo.init().then(function () { hexo.call('generate',{}).then(function () { execSync(`rm -rf docs`); execSync(`mv public docs`); console.log('网站生成完毕'); process.exit(0); }); });
deploy(callback) { const hexo = this.hexo; hexo.call('deploy', {}).then(() => { callback('Deploy success.'); return hexo.exit(); }).catch((err) => { callback('Deploy failed.'); return hexo.exit(err); }); }
generate(callback) { const hexo = this.hexo; hexo.call('generate', {}).then(() => { callback('Generate success.'); return hexo.exit(); }).catch((err) => { callback('Generate failed.'); return hexo.exit(err); }); }
hexo.init().then(function() { var cmd = args._.shift(); var c = hexo.extend.console.get(cmd); if (c) { hexo.call(cmd, args).then(function() { switch (cmd) { case 'publish': hexo.emit('publishAfter'); break; case 'clean': hexo.emit('cleanAfter'); break; } return hexo.exit(); }).catch(function(err) { return hexo.exit(err); }); } else { console.error('Unsupported command.'); } });
hexo.init().then(function () { return hexo.call('generate', {}); })
hexo.init().then(function () { hexo.call('generate', {force: true}).then(resolve, reject); });
hexo.init().then(function(){ hexo.call('generate'); }).catch(function(err){