@dxworks/dx 1.6.3 → 1.6.5

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/dist/dx.jar CHANGED
Binary file
package/dist/lib.js CHANGED
@@ -1,9 +1,15 @@
1
1
  const {JavaCaller} = require('java-caller');
2
2
 
3
+ // Runs the given JavaCaller instance with quoted arguments
4
+ async function runJava(java, args) {
5
+ const quotedArgs = args.map(arg => (arg.includes(' ') ? `"${arg}"` : arg));
6
+ return await java.run(quotedArgs);
7
+ }
8
+
3
9
  async function dx() {
4
10
  const java = new JavaCaller({
5
11
  classPath: 'dx.jar', // CLASSPATH referencing the package embedded jar files
6
- mainClass: 'org.dxworks.dx.DxMain',// Main class to call, must be available from CLASSPATH,
12
+ mainClass: 'org.dxworks.dx.DxMain', // Main class to call, must be available from CLASSPATH
7
13
  rootPath: __dirname,
8
14
  minimumJavaVersion: 11,
9
15
  output: 'console'
@@ -14,7 +20,7 @@ async function dx() {
14
20
  if(index === -1)
15
21
  index = 1
16
22
  args.splice(0, index + 1);
17
- const {status} = await java.run(args);
23
+ const {status} = await runJava(java, args);
18
24
  process.exitCode = status;
19
25
  }
20
26
 
@@ -33,7 +39,7 @@ async function graphs() {
33
39
  index = 1
34
40
  args.splice(0, index + 1);
35
41
  args.unshift('-graph')
36
- const {status} = await java.run(args);
42
+ const {status} = await runJava(java, args);
37
43
  process.exitCode = status;
38
44
  }
39
45
 
@@ -51,7 +57,7 @@ async function structminer() {
51
57
  if(index === -1)
52
58
  index = 1
53
59
  args.splice(0, index + 1);
54
- const {status} = await java.run(args);
60
+ const {status} = await runJava(java, args);
55
61
  process.exitCode = status;
56
62
  }
57
63
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxworks/dx",
3
- "version": "1.6.3",
3
+ "version": "1.6.5",
4
4
  "description": "DX Quality Assessment Tool",
5
5
  "main": "dx.js",
6
6
  "files": [