@extrahorizon/exh-cli 1.10.0-dev-105-4051888 → 1.10.0-dev-106-ff8535b
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.
|
@@ -29,7 +29,7 @@ const handler = async function init({ name, path }) {
|
|
|
29
29
|
exports.handler = handler;
|
|
30
30
|
function createSchema(name) {
|
|
31
31
|
return {
|
|
32
|
-
$schema:
|
|
32
|
+
$schema: `https://swagger.extrahorizon.com/cli/${(0, util_1.getCliVersion)()}/config-json-schemas/Schema.json`,
|
|
33
33
|
name,
|
|
34
34
|
description: `The ${name} schema`,
|
|
35
35
|
createMode: 'allUsers',
|
|
@@ -34,6 +34,7 @@ async function changePackageFile(name) {
|
|
|
34
34
|
}
|
|
35
35
|
try {
|
|
36
36
|
const taskConfig = JSON.parse((await (0, promises_1.readFile)(`${name}/task-config.json`)).toString());
|
|
37
|
+
taskConfig.$schema = `https://swagger.extrahorizon.com/cli/${(0, util_1.getCliVersion)()}/config-json-schemas/TaskConfig.json`;
|
|
37
38
|
taskConfig.name = name;
|
|
38
39
|
taskConfig.description = `${name} task`;
|
|
39
40
|
await (0, promises_1.writeFile)(`${name}/task-config.json`, JSON.stringify(taskConfig, null, 4));
|
package/build/helpers/util.d.ts
CHANGED
package/build/helpers/util.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadAndAssertCredentials = exports.asyncExec = exports.epilogue = void 0;
|
|
3
|
+
exports.getCliVersion = exports.loadAndAssertCredentials = exports.asyncExec = exports.epilogue = void 0;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
5
|
const fs = require("fs");
|
|
6
|
+
const path = require("path");
|
|
6
7
|
const chalk = require("chalk");
|
|
7
8
|
const constants_1 = require("../constants");
|
|
8
9
|
const error_1 = require("./error");
|
|
@@ -65,3 +66,9 @@ function loadAndAssertCredentials() {
|
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
exports.loadAndAssertCredentials = loadAndAssertCredentials;
|
|
69
|
+
function getCliVersion() {
|
|
70
|
+
const packageJsonPath = path.join(__dirname, '../../package.json');
|
|
71
|
+
const packageJsonString = fs.readFileSync(packageJsonPath, 'utf-8');
|
|
72
|
+
return JSON.parse(packageJsonString).version;
|
|
73
|
+
}
|
|
74
|
+
exports.getCliVersion = getCliVersion;
|