java-portable
Advanced tools
+2
-2
| { | ||
| "name": "java-portable", | ||
| "version": "2.0.0", | ||
| "version": "2.1.0", | ||
| "dependencies": {}, | ||
| "tag": { | ||
| "commit": "579dacb82632ab130705decfd355537f33c86a9a", | ||
| "commit": "39c9061d0a7b6844add8b2558833cc29505331b7", | ||
| "target": { | ||
@@ -8,0 +8,0 @@ "branch": "master" |
+15
-13
@@ -23,17 +23,19 @@ const path = require( 'path' ); | ||
| function getHostVersions( nodeJavaPath ) { | ||
| const javaVersion = findClosestJavaVersion(); | ||
| const nodeJavaVersion = getNodeJavaVersion( nodeJavaPath ); | ||
| return { | ||
| node: { | ||
| arch: process.arch, | ||
| version: process.version, | ||
| abi: process.versions.modules | ||
| }, | ||
| nodeJava: { | ||
| version: nodeJavaVersion | ||
| }, | ||
| java: javaVersion || { dir: '' } | ||
| }; | ||
| return findClosestJavaVersion() | ||
| .then( javaVersion => { | ||
| const nodeJavaVersion = getNodeJavaVersion( nodeJavaPath ); | ||
| return { | ||
| node: { | ||
| arch: process.arch, | ||
| version: process.version, | ||
| abi: process.versions.modules | ||
| }, | ||
| nodeJava: { | ||
| version: nodeJavaVersion | ||
| }, | ||
| java: javaVersion || { dir: '' } | ||
| }; | ||
| } ); | ||
| } | ||
| module.exports = getHostVersions; |
+17
-15
@@ -46,18 +46,20 @@ const fs = require( 'fs' ); | ||
| options = getOptions( options ); | ||
| const currentVersions = getHostVersions( options.nodeJavaPath ); | ||
| const savedVersions = fs.existsSync( options.versionsJsonPath ) ? JSON.parse( fs.readFileSync( options.versionsJsonPath, 'utf8' ) ) : null; | ||
| if ( savedVersions ) { | ||
| const rejectionReasons = []; | ||
| compareVersions( currentVersions, savedVersions, rejectionReasons ); | ||
| if ( rejectionReasons.length > 0 ) { | ||
| throw new Error( rejectionReasons.join( "\r\n" ) ); | ||
| return getHostVersions( options.nodeJavaPath ) | ||
| .then( ( currentVersions ) => { | ||
| const savedVersions = fs.existsSync( options.versionsJsonPath ) ? JSON.parse( fs.readFileSync( options.versionsJsonPath, 'utf8' ) ) : null; | ||
| if ( savedVersions ) { | ||
| const rejectionReasons = []; | ||
| compareVersions( currentVersions, savedVersions, rejectionReasons ); | ||
| if ( rejectionReasons.length > 0 ) { | ||
| throw new Error( rejectionReasons.join( "\r\n" ) ); | ||
| } | ||
| } | ||
| } | ||
| let closest = null; | ||
| if ( savedVersions && savedVersions.java ) { | ||
| closest = savedVersions.java; | ||
| } else if ( options.fallback ) { | ||
| closest = { version: options.fallback }; | ||
| } | ||
| return findClosestJavaVersion( closest, options ) | ||
| let closest = null; | ||
| if ( savedVersions && savedVersions.java && savedVersions.java.dir && savedVersions.java.version ) { | ||
| closest = savedVersions.java; | ||
| } else if ( options.fallback ) { | ||
| closest = { version: options.fallback }; | ||
| } | ||
| return findClosestJavaVersion( closest, options ) | ||
| } ) | ||
| .then( ( version ) => { | ||
@@ -64,0 +66,0 @@ if ( !version ) { |
@@ -11,11 +11,13 @@ const path = require( 'path' ); | ||
| // record version of node.js and JDK / JRE, which is then used to check when executing the actual module | ||
| const versions = getHostVersions( options.nodeJavaPath ); | ||
| const versionsPath = options.versionsJsonPath || path.join( __dirname, '..', 'versions.json' ); | ||
| const versionsDir = path.dirname( versionsPath ); | ||
| if ( !fs.existsSync( versionsDir ) ) { | ||
| mkdirp.sync( versionsDir ); | ||
| } | ||
| fs.writeFileSync( versionsPath, JSON.stringify( versions, null, 2 ), 'utf8' ); | ||
| return getHostVersions( options.nodeJavaPath ) | ||
| .then( versions => { | ||
| const versionsPath = options.versionsJsonPath || path.join( __dirname, '..', 'versions.json' ); | ||
| const versionsDir = path.dirname( versionsPath ); | ||
| if ( !fs.existsSync( versionsDir ) ) { | ||
| mkdirp.sync( versionsDir ); | ||
| } | ||
| fs.writeFileSync( versionsPath, JSON.stringify( versions, null, 2 ), 'utf8' ); | ||
| } ); | ||
| } | ||
| module.exports = postInstall; |
+1
-1
| { | ||
| "name": "java-portable", | ||
| "version": "2.0.0", | ||
| "version": "2.1.0", | ||
| "description": "Wrapper for the node-java npm package that improves locating the JRE on the target machine and can support multiple prebuilt platform builds", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1407
0.43%2
-33.33%48090
-1.56%19
-5%