From 0146c2991bcac4856095c111deac7773c8eaa90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Go=C5=82=C4=99biewski?= Date: Mon, 20 Mar 2017 10:54:57 +0100 Subject: [PATCH] Fix output path option reading --- dist/src/main/Application.js | 2 +- dist/src/main/Application.js.map | 2 +- package.json | 2 +- src/main/Application.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/src/main/Application.js b/dist/src/main/Application.js index 102b327..672f924 100644 --- a/dist/src/main/Application.js +++ b/dist/src/main/Application.js @@ -17,7 +17,7 @@ var Application = (function () { .version(project.version) .parse(process.argv); var inputPath = path.resolve(cli.args[0] || 'main.raml'); - var outputPath = path.resolve(cli.optionFor('output') || 'ramlunit-report.xml'); + var outputPath = path.resolve(cli.output || 'ramlunit-report.xml'); var verbose = !!cli.debug; console.log("Running RamlUnit v" + project.version + " in " + (verbose ? 'debug' : 'regular') + " mode"); console.log("Reading RAML from " + inputPath + "..."); diff --git a/dist/src/main/Application.js.map b/dist/src/main/Application.js.map index 5edb2b6..8538c6c 100644 --- a/dist/src/main/Application.js.map +++ b/dist/src/main/Application.js.map @@ -1 +1 @@ -{"version":3,"file":"Application.js","sourceRoot":"","sources":["../../../src/main/Application.ts"],"names":[],"mappings":";;AAAA,+BAAkC;AAClC,6BAA+B;AAC/B,2BAA6B;AAC7B,6EAAyE;AACzE,4DAAwD;AAExD;IAAA;IAmCA,CAAC;IAjCiB,eAAG,GAAjB;QAGI,IAAM,OAAO,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;QAEhD,GAAG;aACE,MAAM,CAAC,oCAAoC,EAAE,aAAa,CAAC;aAC3D,MAAM,CAAC,aAAa,EAAE,0BAA0B,CAAC;aACjD,KAAK,CAAC,uBAAuB,CAAC;aAC9B,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;aACxB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAExB,IAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,CAAA;QAC1D,IAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,qBAAqB,CAAC,CAAA;QACjF,IAAM,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAA;QAE3B,OAAO,CAAC,GAAG,CAAC,uBAAqB,OAAO,CAAC,OAAO,aAAO,OAAO,GAAG,OAAO,GAAG,SAAS,WAAO,CAAC,CAAA;QAC5F,OAAO,CAAC,GAAG,CAAC,uBAAqB,SAAS,QAAK,CAAC,CAAA;QAEhD,IAAM,UAAU,GAAG,IAAI,uBAAU,CAAC;YAC9B,IAAI,iCAAe,CAAC,SAAS,CAAC;SACjC,EAAE,OAAO,CAAC,CAAA;QAEX,IAAM,WAAW,GAAG,UAAU,CAAC,GAAG,EAAE,CAAA;QACpC,IAAM,MAAM,GAAG,WAAW,CAAC,WAAW,EAAE,GAAG,QAAQ,GAAG,QAAQ,CAAA;QAE9D,OAAO,CAAC,GAAG,CAAC,sBAAoB,MAAM,MAAG,CAAC,CAAA;QAE1C,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,CAAA;QAC7B,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAA;QAEpD,OAAO,CAAC,GAAG,CAAC,qBAAmB,UAAU,MAAG,CAAC,CAAA;IACjD,CAAC;IACL,kBAAC;AAAD,CAAC,AAnCD,IAmCC;AAnCY,kCAAW","sourcesContent":["import cli = require('commander')\nimport fs = require('fs-extra')\nimport path = require('path')\nimport {ParserTestSuite} from '../context/testing/parser/ParserTestSuite'\nimport {TestRunner} from '../context/testing/TestRunner'\n\nexport class Application {\n\n public static run() {\n\n // package.json path relative to compiled Application.js file\n const project = require('../../../package.json')\n\n cli\n .option('-o, --output ', 'output path')\n .option('-d, --debug', 'enable very verbose mode')\n .usage('[options] ')\n .version(project.version)\n .parse(process.argv)\n\n const inputPath = path.resolve(cli.args[0] || 'main.raml')\n const outputPath = path.resolve(cli.optionFor('output') || 'ramlunit-report.xml')\n const verbose = !!cli.debug\n\n console.log(`Running RamlUnit v${project.version} in ${verbose ? 'debug' : 'regular'} mode`)\n console.log(`Reading RAML from ${inputPath}...`)\n\n const testRunner = new TestRunner([\n new ParserTestSuite(inputPath),\n ], verbose)\n\n const xmlDocument = testRunner.run()\n const status = xmlDocument.hasFailures() ? 'Failed' : 'Passed'\n\n console.log(`Analysis result: ${status}.`)\n\n fs.ensureFileSync(outputPath)\n fs.writeFileSync(outputPath, xmlDocument.toString())\n\n console.log(`Report saved to ${outputPath}.`)\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"Application.js","sourceRoot":"","sources":["../../../src/main/Application.ts"],"names":[],"mappings":";;AAAA,+BAAkC;AAClC,6BAA+B;AAC/B,2BAA6B;AAC7B,6EAAyE;AACzE,4DAAwD;AAExD;IAAA;IAmCA,CAAC;IAjCiB,eAAG,GAAjB;QAGI,IAAM,OAAO,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;QAEhD,GAAG;aACE,MAAM,CAAC,oCAAoC,EAAE,aAAa,CAAC;aAC3D,MAAM,CAAC,aAAa,EAAE,0BAA0B,CAAC;aACjD,KAAK,CAAC,uBAAuB,CAAC;aAC9B,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;aACxB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAExB,IAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,CAAA;QAC1D,IAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,qBAAqB,CAAC,CAAA;QACpE,IAAM,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAA;QAE3B,OAAO,CAAC,GAAG,CAAC,uBAAqB,OAAO,CAAC,OAAO,aAAO,OAAO,GAAG,OAAO,GAAG,SAAS,WAAO,CAAC,CAAA;QAC5F,OAAO,CAAC,GAAG,CAAC,uBAAqB,SAAS,QAAK,CAAC,CAAA;QAEhD,IAAM,UAAU,GAAG,IAAI,uBAAU,CAAC;YAC9B,IAAI,iCAAe,CAAC,SAAS,CAAC;SACjC,EAAE,OAAO,CAAC,CAAA;QAEX,IAAM,WAAW,GAAG,UAAU,CAAC,GAAG,EAAE,CAAA;QACpC,IAAM,MAAM,GAAG,WAAW,CAAC,WAAW,EAAE,GAAG,QAAQ,GAAG,QAAQ,CAAA;QAE9D,OAAO,CAAC,GAAG,CAAC,sBAAoB,MAAM,MAAG,CAAC,CAAA;QAE1C,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,CAAA;QAC7B,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAA;QAEpD,OAAO,CAAC,GAAG,CAAC,qBAAmB,UAAU,MAAG,CAAC,CAAA;IACjD,CAAC;IACL,kBAAC;AAAD,CAAC,AAnCD,IAmCC;AAnCY,kCAAW","sourcesContent":["import cli = require('commander')\nimport fs = require('fs-extra')\nimport path = require('path')\nimport {ParserTestSuite} from '../context/testing/parser/ParserTestSuite'\nimport {TestRunner} from '../context/testing/TestRunner'\n\nexport class Application {\n\n public static run() {\n\n // package.json path relative to compiled Application.js file\n const project = require('../../../package.json')\n\n cli\n .option('-o, --output ', 'output path')\n .option('-d, --debug', 'enable very verbose mode')\n .usage('[options] ')\n .version(project.version)\n .parse(process.argv)\n\n const inputPath = path.resolve(cli.args[0] || 'main.raml')\n const outputPath = path.resolve(cli.output || 'ramlunit-report.xml')\n const verbose = !!cli.debug\n\n console.log(`Running RamlUnit v${project.version} in ${verbose ? 'debug' : 'regular'} mode`)\n console.log(`Reading RAML from ${inputPath}...`)\n\n const testRunner = new TestRunner([\n new ParserTestSuite(inputPath),\n ], verbose)\n\n const xmlDocument = testRunner.run()\n const status = xmlDocument.hasFailures() ? 'Failed' : 'Passed'\n\n console.log(`Analysis result: ${status}.`)\n\n fs.ensureFileSync(outputPath)\n fs.writeFileSync(outputPath, xmlDocument.toString())\n\n console.log(`Report saved to ${outputPath}.`)\n }\n}\n"]} \ No newline at end of file diff --git a/package.json b/package.json index a327903..27df7c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ramlunit", - "version": "3.0.1", + "version": "3.0.2", "description": "Validate RAML and generate JUnit-like report.", "author": "Piotr Gołębiewski ", "license": "MIT", diff --git a/src/main/Application.ts b/src/main/Application.ts index 156d9bd..610de6e 100644 --- a/src/main/Application.ts +++ b/src/main/Application.ts @@ -19,7 +19,7 @@ export class Application { .parse(process.argv) const inputPath = path.resolve(cli.args[0] || 'main.raml') - const outputPath = path.resolve(cli.optionFor('output') || 'ramlunit-report.xml') + const outputPath = path.resolve(cli.output || 'ramlunit-report.xml') const verbose = !!cli.debug console.log(`Running RamlUnit v${project.version} in ${verbose ? 'debug' : 'regular'} mode`)