@caleuche/cli 0.4.0 → 0.4.1
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/CHANGELOG.md +8 -0
- package/package.json +2 -2
- package/src/batch.ts +14 -5
- package/src/index.ts +20 -5
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caleuche/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"bin": {
|
|
6
6
|
"che": "dist/index.js"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"description": "Caleuche CLI",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@caleuche/core": "^0.
|
|
22
|
+
"@caleuche/core": "^0.3.0",
|
|
23
23
|
"commander": "^14.0.0",
|
|
24
24
|
"yaml": "^2.8.0"
|
|
25
25
|
},
|
package/src/batch.ts
CHANGED
|
@@ -80,7 +80,10 @@ function resolveVariantDefinition(
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
export function batchCompile(
|
|
83
|
+
export function batchCompile(
|
|
84
|
+
batchFile: string,
|
|
85
|
+
options: { outputDir?: string },
|
|
86
|
+
) {
|
|
84
87
|
if (!isFile(batchFile)) {
|
|
85
88
|
console.error(`Batch file "${batchFile}" does not exist or is not a file.`);
|
|
86
89
|
process.exit(1);
|
|
@@ -127,12 +130,18 @@ export function batchCompile(batchFile: string, options: { outputDir?: string })
|
|
|
127
130
|
|
|
128
131
|
const effectiveOutputPath = path.join(
|
|
129
132
|
options?.outputDir || workingDirectory,
|
|
130
|
-
variant.output
|
|
133
|
+
variant.output,
|
|
134
|
+
);
|
|
131
135
|
|
|
132
136
|
if (
|
|
133
|
-
!compileAndWriteOutput(
|
|
134
|
-
|
|
135
|
-
|
|
137
|
+
!compileAndWriteOutput(
|
|
138
|
+
sample,
|
|
139
|
+
resolvedVariant.properties,
|
|
140
|
+
effectiveOutputPath,
|
|
141
|
+
{
|
|
142
|
+
project: true,
|
|
143
|
+
},
|
|
144
|
+
)
|
|
136
145
|
) {
|
|
137
146
|
console.error(
|
|
138
147
|
`Sample: ${sampleDefinition.templatePath}, Variant: ${JSON.stringify(variant)}`,
|
package/src/index.ts
CHANGED
|
@@ -12,16 +12,31 @@ program
|
|
|
12
12
|
|
|
13
13
|
program
|
|
14
14
|
.command("compile")
|
|
15
|
-
.argument(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
.argument(
|
|
16
|
+
"<sample-path>",
|
|
17
|
+
"Path to the sample file or the directory that containes it.",
|
|
18
|
+
)
|
|
19
|
+
.argument(
|
|
20
|
+
"<data-file>",
|
|
21
|
+
"Path to the input to be used to compile the template.",
|
|
22
|
+
)
|
|
23
|
+
.argument(
|
|
24
|
+
"<output-directory>",
|
|
25
|
+
"Directory where the compiled output will be written.",
|
|
26
|
+
)
|
|
27
|
+
.option(
|
|
28
|
+
"-p, --project",
|
|
29
|
+
"Flag to indicate whether to generate the appropriate project file along with the compiled template.",
|
|
30
|
+
)
|
|
19
31
|
.action(compile);
|
|
20
32
|
|
|
21
33
|
program
|
|
22
34
|
.command("batch")
|
|
23
35
|
.argument("<batch-file>", "Path to the batch file")
|
|
24
|
-
.option(
|
|
36
|
+
.option(
|
|
37
|
+
"-d, --output-dir <outputDir>",
|
|
38
|
+
"Output directory for compiled samples",
|
|
39
|
+
)
|
|
25
40
|
.action(batchCompile);
|
|
26
41
|
|
|
27
42
|
program.parse();
|