diff --git a/tasks/build/notice.js b/tasks/build/notice.js index 8523462bc82dc..825a390219e67 100644 --- a/tasks/build/notice.js +++ b/tasks/build/notice.js @@ -16,12 +16,21 @@ export default function licenses(grunt) { cwd: buildPath }); installedPackages.toString().trim().split('\n').forEach(pkg => { + let modulePath; + let dirPath; + let packageName; + let drive; const packageDetails = pkg.split(':'); - const [modulePath, packageName] = packageDetails; + if (/^win/.test(process.platform)) { + [drive, dirPath, packageName] = packageDetails; + modulePath = `${drive}:${dirPath}`; + } else { + [modulePath, packageName] = packageDetails; + } const licenses = glob.sync(path.join(modulePath, '*LICENSE*')); const notices = glob.sync(path.join(modulePath, '*NOTICE*')); packagePaths[packageName] = { - relative: modulePath.replace(/.*\/kibana\//, ''), + relative: modulePath.replace(/.*(\/|\\)kibana(\/|\\)/, ''), licenses, notices };