You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
536 B
20 lines
536 B
'use strict'; |
|
|
|
const tildify = require('tildify'); |
|
const { magenta } = require('picocolors'); |
|
|
|
function publishConsole(args) { |
|
// Display help message if user didn't input any arguments |
|
if (!args._.length) { |
|
return this.call('help', {_: ['publish']}); |
|
} |
|
|
|
return this.post.publish({ |
|
slug: args._.pop(), |
|
layout: args._.length ? args._[0] : this.config.default_layout |
|
}, args.r || args.replace).then(post => { |
|
this.log.info('Published: %s', magenta(tildify(post.path))); |
|
}); |
|
} |
|
|
|
module.exports = publishConsole;
|
|
|