diff --git a/lib/licenseCheckerHelpers.js b/lib/licenseCheckerHelpers.js index e7c33ed..e2e83a4 100644 --- a/lib/licenseCheckerHelpers.js +++ b/lib/licenseCheckerHelpers.js @@ -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); }