@hintoai/cli 0.3.5 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api/articles.d.ts
CHANGED
|
@@ -110,18 +110,24 @@ function registerArticles(program, client) {
|
|
|
110
110
|
.description('Update an article')
|
|
111
111
|
.option('--title <title>', 'New title')
|
|
112
112
|
.option('--slug <slug>', 'New slug')
|
|
113
|
+
.option('--content <content>', 'New Markdown content (string or @filepath) — replaces the body')
|
|
113
114
|
.option('--meta-description <text>', 'SEO meta description')
|
|
114
115
|
.option('--meta-keywords <keywords>', 'Comma-separated SEO keywords')
|
|
115
116
|
.option('--json', 'Output as JSON')
|
|
116
117
|
.action(async (id, opts) => {
|
|
117
118
|
try {
|
|
118
|
-
if (!opts.title &&
|
|
119
|
-
|
|
119
|
+
if (!opts.title &&
|
|
120
|
+
!opts.slug &&
|
|
121
|
+
!opts.content &&
|
|
122
|
+
!opts.metaDescription &&
|
|
123
|
+
!opts.metaKeywords) {
|
|
124
|
+
(0, errors_1.exitWithError)('Provide at least one field to update: --title, --slug, --content, --meta-description, or --meta-keywords');
|
|
120
125
|
return;
|
|
121
126
|
}
|
|
122
127
|
const data = await api.update(id, {
|
|
123
128
|
...(opts.title !== undefined && { title: opts.title }),
|
|
124
129
|
...(opts.slug !== undefined && { slug: opts.slug }),
|
|
130
|
+
...(opts.content !== undefined && { content: resolveContent(opts.content) }),
|
|
125
131
|
...(opts.metaDescription !== undefined && { metaDescription: opts.metaDescription }),
|
|
126
132
|
...(opts.metaKeywords !== undefined && {
|
|
127
133
|
metaKeywords: opts.metaKeywords
|