airgen-cli 0.2.1 → 0.2.2
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.
|
@@ -99,7 +99,7 @@ export function registerDocumentCommands(program, client) {
|
|
|
99
99
|
projectKey,
|
|
100
100
|
documentSlug: document,
|
|
101
101
|
name: opts.title,
|
|
102
|
-
order: opts.order ? parseInt(opts.order, 10) :
|
|
102
|
+
order: opts.order ? parseInt(opts.order, 10) : 0,
|
|
103
103
|
description: opts.description,
|
|
104
104
|
shortCode: opts.code,
|
|
105
105
|
});
|
|
@@ -28,9 +28,12 @@ export function registerProjectCommands(program, client) {
|
|
|
28
28
|
.requiredOption("--name <name>", "Project name")
|
|
29
29
|
.option("--key <key>", "Project key")
|
|
30
30
|
.option("--code <code>", "Project code")
|
|
31
|
+
.option("--slug <slug>", "Project slug (auto-generated from name if omitted)")
|
|
31
32
|
.option("--description <desc>", "Description")
|
|
32
33
|
.action(async (tenant, opts) => {
|
|
34
|
+
const slug = opts.slug ?? opts.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
33
35
|
const data = await client.post(`/tenants/${tenant}/projects`, {
|
|
36
|
+
slug,
|
|
34
37
|
name: opts.name,
|
|
35
38
|
key: opts.key,
|
|
36
39
|
code: opts.code,
|