@cyclonedx/cdxgen 8.0.0 → 8.0.1

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.
Files changed (3) hide show
  1. package/README.md +4 -1
  2. package/index.js +16 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ![cdxgen logo](cdxgen.png)
4
4
 
5
- This tool creates a valid and compliant CycloneDX Software Bill-of-Materials (SBOM) containing an aggregate of all project dependencies for c/c++, node.js, php, python, ruby, rust, java, .Net, dart, haskell, elixir, and Go projects in XML and JSON format. CycloneDX 1.4 is a lightweight SBOM specification that is easily created, human and machine-readable, and simple to parse.
5
+ This tool creates a valid and compliant [CycloneDX][cyclonedx-homepage] Software Bill-of-Materials (SBOM) containing an aggregate of all project dependencies for c/c++, node.js, php, python, ruby, rust, java, .Net, dart, haskell, elixir, and Go projects in XML and JSON format. CycloneDX 1.4 is a lightweight SBOM specification that is easily created, human and machine-readable, and simple to parse.
6
6
 
7
7
  When used with plugins, cdxgen could generate an SBoM for Linux docker images and even VMs running Linux or Windows operating system.
8
8
 
@@ -352,3 +352,6 @@ Permission to modify and redistribute is granted under the terms of the Apache 2
352
352
  ## Discord support
353
353
 
354
354
  The developers could be reached via the [discord](https://discord.gg/DCNxzaeUpd) channel.
355
+
356
+
357
+ [cyclonedx-homepage]: https://cyclonedx.org
package/index.js CHANGED
@@ -3079,6 +3079,9 @@ const createPHPBom = async (path, options) => {
3079
3079
  const composerLockMode = composerLockFiles.length;
3080
3080
  // Create a composer.lock file for each composer.json file if needed.
3081
3081
  if (!composerLockMode && composerJsonMode && options.installDeps) {
3082
+ if (DEBUG_MODE) {
3083
+ console.log("About to invoke composer --version");
3084
+ }
3082
3085
  const versionResult = spawnSync("composer", ["--version"], {
3083
3086
  encoding: "utf-8"
3084
3087
  });
@@ -3086,18 +3089,26 @@ const createPHPBom = async (path, options) => {
3086
3089
  console.error(
3087
3090
  "No composer version found. Check if composer is installed and available in PATH."
3088
3091
  );
3089
- console.log(versionResult.error, versionResult.stderr);
3092
+ if (DEBUG_MODE) {
3093
+ console.log(versionResult.error, versionResult.stderr);
3094
+ }
3090
3095
  options.failOnError && process.exit(1);
3091
- return {};
3092
3096
  }
3093
- const composerVersion = versionResult.stdout.match(/version (\d)/)[1];
3097
+ let composerVersion = undefined;
3094
3098
  if (DEBUG_MODE) {
3095
- console.log("Detected composer version:", composerVersion);
3099
+ console.log("Parsing version", versionResult.stdout);
3100
+ }
3101
+ let tmpV = undefined;
3102
+ if (versionResult && versionResult.stdout) {
3103
+ versionResult.stdout.split(" ");
3104
+ }
3105
+ if (tmpV && tmpV.length > 1) {
3106
+ composerVersion = tmpV[1];
3096
3107
  }
3097
3108
  for (let f of composerJsonFiles) {
3098
3109
  const basePath = pathLib.dirname(f);
3099
3110
  let args = [];
3100
- if (composerVersion > 1) {
3111
+ if (composerVersion && !composerVersion.startsWith("1")) {
3101
3112
  console.log("Generating composer.lock in", basePath);
3102
3113
  args = ["update", "--no-install", "--ignore-platform-reqs"];
3103
3114
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyclonedx/cdxgen",
3
- "version": "8.0.0",
3
+ "version": "8.0.1",
4
4
  "description": "Creates CycloneDX Software Bill-of-Materials (SBOM) from source or container image",
5
5
  "homepage": "http://github.com/cyclonedx/cdxgen",
6
6
  "author": "Prabhu Subramanian <prabhu@appthreat.com>",