Skip to content

feat: create dir for output file #1241

@cuhland

Description

@cuhland

Describe the bug

When the output-file contains a path, then the generation fails.
I want to place the result of the sbom not in the root directory, but in a dedicated build folder for further processing in the pipeline.

To Reproduce

The following call

cyclonedx-npm --output-file build/reports/sbom.json

will cause an ERROR and no sbom is generated.

Error: ENOENT: no such file or directory, open '<path>/build/reports/sbom.json'

Process finished with exit code 254

Expected behavior

The folders are generated if the --output-file argument contains a path.

Environment

  • @cyclonedx/cyclonedx-npm version: 1.19.3
  • NPM version: 10.9.0
  • Node version: v23.1.0
  • OS: mac

Metadata

Metadata

Assignees

Labels

breaking-changebreacking change. causes a new major version.enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions