Skip to content

Commit

Permalink
fix: Fix relative path calculation
Browse files Browse the repository at this point in the history
The first argument to path.relative has to be a path, not a full
file path. Kudos to @denniseffing
  • Loading branch information
RSeidelsohn committed Apr 16, 2023
1 parent 61e15ad commit bd6a385
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/licenseCheckerHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const getFormattedOutput = function getFormattedOutput(json, args) {
if (originalLicenseFile && fs.existsSync(originalLicenseFile)) {
if (args.relativeLicensePath) {
if (args.out) {
jsonCopy[moduleName].licenseFile = path.relative(args.out, outPath);
jsonCopy[moduleName].licenseFile = path.relative(path.dirname(args.out), outPath);
} else {
jsonCopy[moduleName].licenseFile = path.relative(process.cwd(), outPath);
}
Expand Down

0 comments on commit bd6a385

Please sign in to comment.