From b92e461bf100da418d347a0510f361bf795f34f8 Mon Sep 17 00:00:00 2001 From: loostro Date: Mon, 20 Mar 2017 10:30:53 +0100 Subject: [PATCH] Remove unnecesary exit code (#3) --- dist/src/main/Application.js | 1 - dist/src/main/Application.js.map | 2 +- package.json | 2 +- src/main/Application.ts | 2 -- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dist/src/main/Application.js b/dist/src/main/Application.js index 1eebc7a..102b327 100644 --- a/dist/src/main/Application.js +++ b/dist/src/main/Application.js @@ -30,7 +30,6 @@ var Application = (function () { fs.ensureFileSync(outputPath); fs.writeFileSync(outputPath, xmlDocument.toString()); console.log("Report saved to " + outputPath + "."); - process.exit(+xmlDocument.hasFailures()); }; return Application; }()); diff --git a/dist/src/main/Application.js.map b/dist/src/main/Application.js.map index 1d9b7b3..5edb2b6 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;IAqCA,CAAC;IAnCiB,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;QAE7C,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,CAAA;IAC5C,CAAC;IACL,kBAAC;AAAD,CAAC,AArCD,IAqCC;AArCY,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 process.exit(+xmlDocument.hasFailures())\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,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 diff --git a/package.json b/package.json index b51fbee..a327903 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ramlunit", - "version": "3.0.0", + "version": "3.0.1", "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 d2f43d4..156d9bd 100644 --- a/src/main/Application.ts +++ b/src/main/Application.ts @@ -38,7 +38,5 @@ export class Application { fs.writeFileSync(outputPath, xmlDocument.toString()) console.log(`Report saved to ${outputPath}.`) - - process.exit(+xmlDocument.hasFailures()) } }