hexo.init().then(function(){
   hexo.call('server', {p:80}).then(function(){
       return hexo.exit();
   }).catch(function(err){
       return hexo.exit(err);
   });
});
Example #2
0
 hexo.init().then(function () {
     hexo.call('generate',{}).then(function () {
         execSync(`rm -rf docs`);
         execSync(`mv public docs`);
         console.log('网站生成完毕');
         process.exit(0);
     });
 });
Example #3
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);
   });
 }
Example #4
0
 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);
   });
 }
Example #5
0
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.');
  }
});
Example #6
0
hexo.init().then(function () {
  return hexo.call('generate', {});
})
Example #7
0
 hexo.init().then(function () {
     hexo.call('generate', {force: true}).then(resolve, reject);
 });
Example #8
0
	hexo.init().then(function(){
	  hexo.call('generate');
	}).catch(function(err){