From 4757980f9ccb737e4b2923abc5337d45eda7020b Mon Sep 17 00:00:00 2001 From: shelley vohr Date: Tue, 23 Jan 2018 18:09:08 -0500 Subject: [PATCH] add license file to npm publish (#11705) --- script/publish-to-npm.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/publish-to-npm.js b/script/publish-to-npm.js index aaf93f33cd9a..0fd3477d0e45 100644 --- a/script/publish-to-npm.js +++ b/script/publish-to-npm.js @@ -21,7 +21,8 @@ const files = [ 'index.js', 'install.js', 'package.json', - 'README.md' + 'README.md', + 'LICENSE' ] const jsonFields = [ @@ -49,9 +50,10 @@ new Promise((resolve, reject) => { tempDir = dirPath // copy files from `/npm` to temp directory files.forEach((name) => { + const noThirdSegment = name === 'README.md' || 'LICENSE' fs.writeFileSync( path.join(tempDir, name), - fs.readFileSync(path.join(__dirname, '..', name === 'README.md' ? '' : 'npm', name)) + fs.readFileSync(path.join(__dirname, '..', noThirdSegment ? '' : 'npm', name)) ) }) // copy from root package.json to temp/package.json