/
githubmirror
/
hexo
Обзор
Документация
Войти
/
githubmirror
/
hexo
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/plugins/console/publish.ts
27 строк
712 B
D-Sketon
refactor: refactor types & support warehouse6 (#5483)
22 янв 2025, 10:05
Не верифицирован
22 янв 2025, 10:05
70efca7
Код
Авторство
О чём код?
import tildify from 'tildify'; import { magenta } from 'picocolors'; import type Hexo from '../../hexo'; import type Promise from 'bluebird'; interface PublishArgs { _: string[] r?: boolean replace?: boolean [key: string]: any } function publishConsole(this: Hexo, args: PublishArgs): Promise<void> { // 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))); }); } export = publishConsole;