@angeloashmore/prismic-cli-poc 0.0.0-canary.1d36cd8
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/LICENSE +202 -0
- package/README.md +98 -0
- package/dist/index.mjs +2548 -0
- package/package.json +53 -0
- package/src/codegen-types.ts +82 -0
- package/src/codegen.ts +45 -0
- package/src/custom-type-add-field-boolean.ts +192 -0
- package/src/custom-type-add-field-color.ts +177 -0
- package/src/custom-type-add-field-date.ts +180 -0
- package/src/custom-type-add-field-embed.ts +177 -0
- package/src/custom-type-add-field-geo-point.ts +174 -0
- package/src/custom-type-add-field-image.ts +177 -0
- package/src/custom-type-add-field-key-text.ts +177 -0
- package/src/custom-type-add-field-link.ts +201 -0
- package/src/custom-type-add-field-number.ts +209 -0
- package/src/custom-type-add-field-rich-text.ts +202 -0
- package/src/custom-type-add-field-select.ts +192 -0
- package/src/custom-type-add-field-timestamp.ts +180 -0
- package/src/custom-type-add-field-uid.ts +177 -0
- package/src/custom-type-add-field.ts +111 -0
- package/src/custom-type-connect-slice.ts +220 -0
- package/src/custom-type-create.ts +118 -0
- package/src/custom-type-disconnect-slice.ts +177 -0
- package/src/custom-type-list.ts +110 -0
- package/src/custom-type-remove-field.ts +177 -0
- package/src/custom-type-remove.ts +144 -0
- package/src/custom-type-set-name.ts +144 -0
- package/src/custom-type-view.ts +118 -0
- package/src/custom-type.ts +85 -0
- package/src/index.ts +127 -0
- package/src/init.ts +64 -0
- package/src/lib/auth.ts +83 -0
- package/src/lib/config.ts +111 -0
- package/src/lib/custom-types-api.ts +438 -0
- package/src/lib/file.ts +49 -0
- package/src/lib/framework.ts +143 -0
- package/src/lib/json.ts +3 -0
- package/src/lib/request.ts +116 -0
- package/src/lib/slice.ts +115 -0
- package/src/lib/string.ts +6 -0
- package/src/lib/url.ts +25 -0
- package/src/locale-add.ts +116 -0
- package/src/locale-list.ts +107 -0
- package/src/locale-remove.ts +88 -0
- package/src/locale-set-default.ts +131 -0
- package/src/locale.ts +60 -0
- package/src/login.ts +152 -0
- package/src/logout.ts +36 -0
- package/src/page-type-add-field-boolean.ts +192 -0
- package/src/page-type-add-field-color.ts +177 -0
- package/src/page-type-add-field-date.ts +180 -0
- package/src/page-type-add-field-embed.ts +177 -0
- package/src/page-type-add-field-geo-point.ts +174 -0
- package/src/page-type-add-field-image.ts +177 -0
- package/src/page-type-add-field-key-text.ts +177 -0
- package/src/page-type-add-field-link.ts +201 -0
- package/src/page-type-add-field-number.ts +209 -0
- package/src/page-type-add-field-rich-text.ts +202 -0
- package/src/page-type-add-field-select.ts +192 -0
- package/src/page-type-add-field-timestamp.ts +180 -0
- package/src/page-type-add-field-uid.ts +177 -0
- package/src/page-type-add-field.ts +111 -0
- package/src/page-type-connect-slice.ts +220 -0
- package/src/page-type-create.ts +142 -0
- package/src/page-type-disconnect-slice.ts +177 -0
- package/src/page-type-list.ts +109 -0
- package/src/page-type-remove-field.ts +177 -0
- package/src/page-type-remove.ts +144 -0
- package/src/page-type-set-name.ts +144 -0
- package/src/page-type-set-repeatable.ts +153 -0
- package/src/page-type-view.ts +118 -0
- package/src/page-type.ts +90 -0
- package/src/preview-add.ts +126 -0
- package/src/preview-get-simulator.ts +104 -0
- package/src/preview-list.ts +106 -0
- package/src/preview-remove-simulator.ts +80 -0
- package/src/preview-remove.ts +109 -0
- package/src/preview-set-name.ts +137 -0
- package/src/preview-set-simulator.ts +116 -0
- package/src/preview.ts +75 -0
- package/src/pull.ts +247 -0
- package/src/push.ts +405 -0
- package/src/repo-create.ts +136 -0
- package/src/repo-get-access.ts +86 -0
- package/src/repo-list.ts +100 -0
- package/src/repo-set-access.ts +100 -0
- package/src/repo-set-name.ts +102 -0
- package/src/repo-view.ts +113 -0
- package/src/repo.ts +70 -0
- package/src/slice-add-field-boolean.ts +173 -0
- package/src/slice-add-field-color.ts +158 -0
- package/src/slice-add-field-date.ts +158 -0
- package/src/slice-add-field-embed.ts +158 -0
- package/src/slice-add-field-geo-point.ts +155 -0
- package/src/slice-add-field-image.ts +155 -0
- package/src/slice-add-field-key-text.ts +158 -0
- package/src/slice-add-field-link.ts +178 -0
- package/src/slice-add-field-number.ts +158 -0
- package/src/slice-add-field-rich-text.ts +183 -0
- package/src/slice-add-field-select.ts +173 -0
- package/src/slice-add-field-timestamp.ts +158 -0
- package/src/slice-add-field.ts +106 -0
- package/src/slice-add-variation.ts +145 -0
- package/src/slice-create.ts +148 -0
- package/src/slice-list-variations.ts +67 -0
- package/src/slice-list.ts +88 -0
- package/src/slice-remove-field.ts +128 -0
- package/src/slice-remove-variation.ts +118 -0
- package/src/slice-remove.ts +97 -0
- package/src/slice-rename.ts +128 -0
- package/src/slice-view.ts +77 -0
- package/src/slice.ts +90 -0
- package/src/status.ts +733 -0
- package/src/token-create.ts +203 -0
- package/src/token-delete.ts +182 -0
- package/src/token-list.ts +223 -0
- package/src/token-set-name.ts +193 -0
- package/src/token.ts +60 -0
- package/src/webhook-add-header.ts +118 -0
- package/src/webhook-create.ts +152 -0
- package/src/webhook-disable.ts +109 -0
- package/src/webhook-enable.ts +132 -0
- package/src/webhook-list.ts +93 -0
- package/src/webhook-remove-header.ts +117 -0
- package/src/webhook-remove.ts +106 -0
- package/src/webhook-set-triggers.ts +148 -0
- package/src/webhook-status.ts +90 -0
- package/src/webhook-test.ts +106 -0
- package/src/webhook-view.ts +147 -0
- package/src/webhook.ts +95 -0
- package/src/whoami.ts +62 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { rm } from "node:fs/promises";
|
|
2
|
+
import { parseArgs } from "node:util";
|
|
3
|
+
|
|
4
|
+
import { buildTypes } from "./codegen-types";
|
|
5
|
+
import { findSliceModel } from "./lib/slice";
|
|
6
|
+
|
|
7
|
+
const HELP = `
|
|
8
|
+
Remove a slice from the project.
|
|
9
|
+
|
|
10
|
+
USAGE
|
|
11
|
+
prismic slice remove <slice-id> [flags]
|
|
12
|
+
|
|
13
|
+
ARGUMENTS
|
|
14
|
+
slice-id Slice identifier (required)
|
|
15
|
+
|
|
16
|
+
Types are generated by default after changes. Use --no-types to skip.
|
|
17
|
+
|
|
18
|
+
FLAGS
|
|
19
|
+
-y Confirm removal
|
|
20
|
+
--types string Output file for generated types (default: "prismicio-types.d.ts")
|
|
21
|
+
--no-types Skip type generation
|
|
22
|
+
-h, --help Show help for command
|
|
23
|
+
|
|
24
|
+
EXAMPLES
|
|
25
|
+
prismic slice remove MySlice
|
|
26
|
+
prismic slice remove MySlice -y
|
|
27
|
+
`.trim();
|
|
28
|
+
|
|
29
|
+
export async function sliceRemove(): Promise<void> {
|
|
30
|
+
const {
|
|
31
|
+
values: { help, y, types, "no-types": noTypes },
|
|
32
|
+
positionals: [sliceId],
|
|
33
|
+
} = parseArgs({
|
|
34
|
+
args: process.argv.slice(4), // skip: node, script, "slice", "remove"
|
|
35
|
+
options: {
|
|
36
|
+
y: { type: "boolean", short: "y" },
|
|
37
|
+
types: { type: "string" },
|
|
38
|
+
"no-types": { type: "boolean" },
|
|
39
|
+
help: { type: "boolean", short: "h" },
|
|
40
|
+
},
|
|
41
|
+
allowPositionals: true,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
if (help) {
|
|
45
|
+
console.info(HELP);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (!sliceId) {
|
|
50
|
+
console.error("Missing required argument: slice-id\n");
|
|
51
|
+
console.error("Usage: prismic slice remove <slice-id>");
|
|
52
|
+
process.exitCode = 1;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const result = await findSliceModel(sliceId);
|
|
57
|
+
if (!result.ok) {
|
|
58
|
+
console.error(result.error);
|
|
59
|
+
process.exitCode = 1;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const { modelPath } = result;
|
|
64
|
+
const sliceDirectory = new URL(".", modelPath);
|
|
65
|
+
|
|
66
|
+
// Require -y flag to confirm deletion
|
|
67
|
+
if (!y) {
|
|
68
|
+
console.error(`Refusing to remove slice "${sliceId}" (this will delete the entire directory).`);
|
|
69
|
+
console.error("Re-run with -y to confirm.");
|
|
70
|
+
process.exitCode = 1;
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Delete the slice directory
|
|
75
|
+
try {
|
|
76
|
+
await rm(sliceDirectory, { recursive: true });
|
|
77
|
+
} catch (error) {
|
|
78
|
+
if (error instanceof Error) {
|
|
79
|
+
console.error(`Failed to remove slice: ${error.message}`);
|
|
80
|
+
} else {
|
|
81
|
+
console.error("Failed to remove slice");
|
|
82
|
+
}
|
|
83
|
+
process.exitCode = 1;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
console.info(`Removed slice "${sliceId}"`);
|
|
88
|
+
|
|
89
|
+
if (!noTypes) {
|
|
90
|
+
try {
|
|
91
|
+
await buildTypes({ output: types });
|
|
92
|
+
console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
|
|
93
|
+
} catch (error) {
|
|
94
|
+
console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { rename, writeFile } from "node:fs/promises";
|
|
2
|
+
import { parseArgs } from "node:util";
|
|
3
|
+
|
|
4
|
+
import { buildTypes } from "./codegen-types";
|
|
5
|
+
import { stringify } from "./lib/json";
|
|
6
|
+
import { findSliceModel, getSlicesDirectory, pascalCase } from "./lib/slice";
|
|
7
|
+
|
|
8
|
+
const HELP = `
|
|
9
|
+
Rename a slice (updates name field, optionally id and directory).
|
|
10
|
+
|
|
11
|
+
USAGE
|
|
12
|
+
prismic slice rename <slice-id> <new-name> [flags]
|
|
13
|
+
|
|
14
|
+
ARGUMENTS
|
|
15
|
+
slice-id Current slice identifier (required)
|
|
16
|
+
new-name New display name (required)
|
|
17
|
+
|
|
18
|
+
Types are generated by default after changes. Use --no-types to skip.
|
|
19
|
+
|
|
20
|
+
FLAGS
|
|
21
|
+
--id string Also change the slice ID (renames directory)
|
|
22
|
+
--types string Output file for generated types (default: "prismicio-types.d.ts")
|
|
23
|
+
--no-types Skip type generation
|
|
24
|
+
-h, --help Show help for command
|
|
25
|
+
|
|
26
|
+
EXAMPLES
|
|
27
|
+
prismic slice rename MySlice "My New Name"
|
|
28
|
+
prismic slice rename MySlice "My New Name" --id NewSliceId
|
|
29
|
+
`.trim();
|
|
30
|
+
|
|
31
|
+
export async function sliceRename(): Promise<void> {
|
|
32
|
+
const {
|
|
33
|
+
values: { help, id: newId, types, "no-types": noTypes },
|
|
34
|
+
positionals: [sliceId, newName],
|
|
35
|
+
} = parseArgs({
|
|
36
|
+
args: process.argv.slice(4), // skip: node, script, "slice", "rename"
|
|
37
|
+
options: {
|
|
38
|
+
id: { type: "string" },
|
|
39
|
+
types: { type: "string" },
|
|
40
|
+
"no-types": { type: "boolean" },
|
|
41
|
+
help: { type: "boolean", short: "h" },
|
|
42
|
+
},
|
|
43
|
+
allowPositionals: true,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
if (help) {
|
|
47
|
+
console.info(HELP);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (!sliceId) {
|
|
52
|
+
console.error("Missing required argument: slice-id\n");
|
|
53
|
+
console.error("Usage: prismic slice rename <slice-id> <new-name>");
|
|
54
|
+
process.exitCode = 1;
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (!newName) {
|
|
59
|
+
console.error("Missing required argument: new-name\n");
|
|
60
|
+
console.error("Usage: prismic slice rename <slice-id> <new-name>");
|
|
61
|
+
process.exitCode = 1;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const result = await findSliceModel(sliceId);
|
|
66
|
+
if (!result.ok) {
|
|
67
|
+
console.error(result.error);
|
|
68
|
+
process.exitCode = 1;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const { model, modelPath } = result;
|
|
73
|
+
|
|
74
|
+
// Update the model
|
|
75
|
+
model.name = newName;
|
|
76
|
+
if (newId) {
|
|
77
|
+
model.id = newId;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Write updated model
|
|
81
|
+
try {
|
|
82
|
+
await writeFile(modelPath, stringify(model));
|
|
83
|
+
} catch (error) {
|
|
84
|
+
if (error instanceof Error) {
|
|
85
|
+
console.error(`Failed to update slice: ${error.message}`);
|
|
86
|
+
} else {
|
|
87
|
+
console.error("Failed to update slice");
|
|
88
|
+
}
|
|
89
|
+
process.exitCode = 1;
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// If changing ID, also rename the directory
|
|
94
|
+
if (newId) {
|
|
95
|
+
const slicesDirectory = await getSlicesDirectory();
|
|
96
|
+
const currentDir = new URL(".", modelPath);
|
|
97
|
+
const newDir = new URL(pascalCase(newName) + "/", slicesDirectory);
|
|
98
|
+
|
|
99
|
+
if (currentDir.href !== newDir.href) {
|
|
100
|
+
try {
|
|
101
|
+
await rename(currentDir, newDir);
|
|
102
|
+
console.info(`Renamed slice "${sliceId}" to "${newId}" (${newName})`);
|
|
103
|
+
console.info(`Moved directory to ${newDir.href}`);
|
|
104
|
+
} catch (error) {
|
|
105
|
+
if (error instanceof Error) {
|
|
106
|
+
console.error(`Failed to rename directory: ${error.message}`);
|
|
107
|
+
} else {
|
|
108
|
+
console.error("Failed to rename directory");
|
|
109
|
+
}
|
|
110
|
+
process.exitCode = 1;
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
} else {
|
|
114
|
+
console.info(`Renamed slice "${sliceId}" to "${newId}" (${newName})`);
|
|
115
|
+
}
|
|
116
|
+
} else {
|
|
117
|
+
console.info(`Renamed slice "${sliceId}" to "${newName}"`);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (!noTypes) {
|
|
121
|
+
try {
|
|
122
|
+
await buildTypes({ output: types });
|
|
123
|
+
console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
|
|
124
|
+
} catch (error) {
|
|
125
|
+
console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { parseArgs } from "node:util";
|
|
2
|
+
|
|
3
|
+
import { findSliceModel } from "./lib/slice";
|
|
4
|
+
|
|
5
|
+
const HELP = `
|
|
6
|
+
View details of a specific slice.
|
|
7
|
+
|
|
8
|
+
USAGE
|
|
9
|
+
prismic slice view <slice-id> [flags]
|
|
10
|
+
|
|
11
|
+
ARGUMENTS
|
|
12
|
+
slice-id Slice identifier (required)
|
|
13
|
+
|
|
14
|
+
FLAGS
|
|
15
|
+
--json Output as JSON
|
|
16
|
+
-h, --help Show help for command
|
|
17
|
+
|
|
18
|
+
EXAMPLES
|
|
19
|
+
prismic slice view MySlice
|
|
20
|
+
prismic slice view MySlice --json
|
|
21
|
+
`.trim();
|
|
22
|
+
|
|
23
|
+
export async function sliceView(): Promise<void> {
|
|
24
|
+
const {
|
|
25
|
+
values: { help, json },
|
|
26
|
+
positionals: [sliceId],
|
|
27
|
+
} = parseArgs({
|
|
28
|
+
args: process.argv.slice(4), // skip: node, script, "slice", "view"
|
|
29
|
+
options: {
|
|
30
|
+
json: { type: "boolean" },
|
|
31
|
+
help: { type: "boolean", short: "h" },
|
|
32
|
+
},
|
|
33
|
+
allowPositionals: true,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
if (help) {
|
|
37
|
+
console.info(HELP);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (!sliceId) {
|
|
42
|
+
console.error("Missing required argument: slice-id\n");
|
|
43
|
+
console.error("Usage: prismic slice view <slice-id>");
|
|
44
|
+
process.exitCode = 1;
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const result = await findSliceModel(sliceId);
|
|
49
|
+
if (!result.ok) {
|
|
50
|
+
console.error(result.error);
|
|
51
|
+
process.exitCode = 1;
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const { model } = result;
|
|
56
|
+
|
|
57
|
+
if (json) {
|
|
58
|
+
console.info(JSON.stringify(model, null, 2));
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
console.info(`ID: ${model.id}`);
|
|
63
|
+
console.info(`Name: ${model.name}`);
|
|
64
|
+
if (model.description) {
|
|
65
|
+
console.info(`Description: ${model.description}`);
|
|
66
|
+
}
|
|
67
|
+
console.info(`Variations: ${model.variations.length}`);
|
|
68
|
+
|
|
69
|
+
console.info("\nVariations:");
|
|
70
|
+
for (const variation of model.variations) {
|
|
71
|
+
const primaryFields = Object.keys(variation.primary ?? {}).length;
|
|
72
|
+
const itemsFields = Object.keys(variation.items ?? {}).length;
|
|
73
|
+
console.info(
|
|
74
|
+
` - ${variation.id} (${variation.name}): ${primaryFields} primary fields, ${itemsFields} items fields`,
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
}
|
package/src/slice.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { parseArgs } from "node:util";
|
|
2
|
+
|
|
3
|
+
import { sliceAddField } from "./slice-add-field";
|
|
4
|
+
import { sliceAddVariation } from "./slice-add-variation";
|
|
5
|
+
import { sliceCreate } from "./slice-create";
|
|
6
|
+
import { sliceList } from "./slice-list";
|
|
7
|
+
import { sliceListVariations } from "./slice-list-variations";
|
|
8
|
+
import { sliceRemove } from "./slice-remove";
|
|
9
|
+
import { sliceRemoveField } from "./slice-remove-field";
|
|
10
|
+
import { sliceRemoveVariation } from "./slice-remove-variation";
|
|
11
|
+
import { sliceRename } from "./slice-rename";
|
|
12
|
+
import { sliceView } from "./slice-view";
|
|
13
|
+
|
|
14
|
+
const HELP = `
|
|
15
|
+
Manage slices in a Prismic project.
|
|
16
|
+
|
|
17
|
+
USAGE
|
|
18
|
+
prismic slice <command> [flags]
|
|
19
|
+
|
|
20
|
+
COMMANDS
|
|
21
|
+
create Create a new slice
|
|
22
|
+
list List all slices
|
|
23
|
+
view View details of a slice
|
|
24
|
+
rename Rename a slice
|
|
25
|
+
remove Remove a slice
|
|
26
|
+
add-field Add a field to a slice
|
|
27
|
+
remove-field Remove a field from a slice
|
|
28
|
+
add-variation Add a variation to a slice
|
|
29
|
+
remove-variation Remove a variation from a slice
|
|
30
|
+
list-variations List all variations of a slice
|
|
31
|
+
|
|
32
|
+
FLAGS
|
|
33
|
+
-h, --help Show help for command
|
|
34
|
+
|
|
35
|
+
LEARN MORE
|
|
36
|
+
Use \`prismic slice <command> --help\` for more information about a command.
|
|
37
|
+
`.trim();
|
|
38
|
+
|
|
39
|
+
export async function slice(): Promise<void> {
|
|
40
|
+
const {
|
|
41
|
+
positionals: [subcommand],
|
|
42
|
+
} = parseArgs({
|
|
43
|
+
args: process.argv.slice(3), // skip: node, script, "slice"
|
|
44
|
+
options: {
|
|
45
|
+
help: { type: "boolean", short: "h" },
|
|
46
|
+
},
|
|
47
|
+
allowPositionals: true,
|
|
48
|
+
strict: false,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
switch (subcommand) {
|
|
52
|
+
case "create":
|
|
53
|
+
await sliceCreate();
|
|
54
|
+
break;
|
|
55
|
+
case "list":
|
|
56
|
+
await sliceList();
|
|
57
|
+
break;
|
|
58
|
+
case "view":
|
|
59
|
+
await sliceView();
|
|
60
|
+
break;
|
|
61
|
+
case "rename":
|
|
62
|
+
await sliceRename();
|
|
63
|
+
break;
|
|
64
|
+
case "remove":
|
|
65
|
+
await sliceRemove();
|
|
66
|
+
break;
|
|
67
|
+
case "add-field":
|
|
68
|
+
await sliceAddField();
|
|
69
|
+
break;
|
|
70
|
+
case "remove-field":
|
|
71
|
+
await sliceRemoveField();
|
|
72
|
+
break;
|
|
73
|
+
case "add-variation":
|
|
74
|
+
await sliceAddVariation();
|
|
75
|
+
break;
|
|
76
|
+
case "remove-variation":
|
|
77
|
+
await sliceRemoveVariation();
|
|
78
|
+
break;
|
|
79
|
+
case "list-variations":
|
|
80
|
+
await sliceListVariations();
|
|
81
|
+
break;
|
|
82
|
+
default: {
|
|
83
|
+
if (subcommand) {
|
|
84
|
+
console.error(`Unknown slice subcommand: ${subcommand}\n`);
|
|
85
|
+
process.exitCode = 1;
|
|
86
|
+
}
|
|
87
|
+
console.info(HELP);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|