@cyklang/cli
Advanced tools
Comparing version 0.11.1 to 0.11.2
@@ -185,3 +185,3 @@ #!/usr/bin/env node | ||
program.name('cyk').description('cyklang CLI') | ||
.version('0.9.1'); | ||
.version('0.11.2'); | ||
program.addCommand(new StartCommand('start')); | ||
@@ -188,0 +188,0 @@ program.addCommand(new StopCommand('stop')); |
@@ -38,2 +38,3 @@ #!/usr/bin/env ts-node | ||
const DBClient_1 = require("./DBClient"); | ||
const RunCommand_1 = require("./RunCommand"); | ||
const logger = loglevel_1.default.getLogger("ModuleCommand.ts"); | ||
@@ -139,4 +140,23 @@ logger.setLevel("debug"); | ||
const file = files[ind]; | ||
await uploadModule(file, this.dbManager); | ||
try { | ||
await uploadModule(file, this.dbManager); | ||
} | ||
catch (err) { | ||
logger.error('Error uploading module ' + file, err); | ||
throw err; | ||
} | ||
} | ||
// run *_init.xml files | ||
for (let ind = 0; ind < files.length; ind++) { | ||
const file = files[ind]; | ||
if (file.endsWith('_init.xml')) { | ||
try { | ||
await (0, RunCommand_1.runFile)(file); | ||
logger.info('Run module: ', file); | ||
} | ||
catch (err) { | ||
logger.error('Error running module ' + file, err); | ||
} | ||
} | ||
} | ||
} | ||
@@ -143,0 +163,0 @@ } |
@@ -6,1 +6,7 @@ import { Cmd } from "./Cmd"; | ||
} | ||
/** | ||
* | ||
* @param filename | ||
* @returns | ||
*/ | ||
export declare function runFile(filename: string): Promise<void>; |
@@ -29,3 +29,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.RunCommand = void 0; | ||
exports.runFile = exports.RunCommand = void 0; | ||
const core_1 = require("@cyklang/core"); | ||
@@ -64,2 +64,7 @@ const fs = __importStar(require("fs")); | ||
exports.RunCommand = RunCommand; | ||
/** | ||
* | ||
* @param filename | ||
* @returns | ||
*/ | ||
async function runFile(filename) { | ||
@@ -112,1 +117,2 @@ let result; | ||
} | ||
exports.runFile = runFile; |
{ | ||
"name": "@cyklang/cli", | ||
"version": "0.11.1", | ||
"version": "0.11.2", | ||
"description": "cyklang CLI", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -179,3 +179,3 @@ #!/usr/bin/env node | ||
program.name('cyk').description('cyklang CLI') | ||
.version('0.9.1') | ||
.version('0.11.2') | ||
program.addCommand(new StartCommand('start')) | ||
@@ -182,0 +182,0 @@ program.addCommand(new StopCommand('stop')) |
@@ -9,2 +9,3 @@ #!/usr/bin/env ts-node | ||
import { DBClient } from "./DBClient" | ||
import { runFile } from "./RunCommand" | ||
const logger = loglevel.getLogger("ModuleCommand.ts") | ||
@@ -119,4 +120,23 @@ logger.setLevel("debug") | ||
const file = files[ind] | ||
await uploadModule(file, this.dbManager) | ||
try { | ||
await uploadModule(file, this.dbManager) | ||
} | ||
catch (err) { | ||
logger.error('Error uploading module ' + file, err) | ||
throw err | ||
} | ||
} | ||
// run *_init.xml files | ||
for (let ind = 0; ind < files.length; ind++) { | ||
const file = files[ind] | ||
if (file.endsWith('_init.xml')) { | ||
try { | ||
await runFile(file) | ||
logger.info('Run module: ', file) | ||
} | ||
catch (err) { | ||
logger.error('Error running module ' + file, err) | ||
} | ||
} | ||
} | ||
} | ||
@@ -123,0 +143,0 @@ } |
@@ -35,4 +35,8 @@ import { Structure, Script, XmlError, DBRemote, DBManager, ModuleInstruction, parseXML, MapData } from "@cyklang/core" | ||
async function runFile(filename: string): Promise<void> { | ||
/** | ||
* | ||
* @param filename | ||
* @returns | ||
*/ | ||
export async function runFile(filename: string): Promise<void> { | ||
let result: boolean | ||
@@ -39,0 +43,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
360310
6822